Skip to content
This repository has been archived by the owner on Jul 6, 2021. It is now read-only.

upgrade date-fns to v2 #108

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nasermirzaei89
Copy link

@nasermirzaei89 nasermirzaei89 commented Apr 23, 2020

fixes #104


export default (date, locale, converterOptions) => {
if (typeof date === 'string') {
date = parseISO(date)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not simply new Date()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new Date??? <- this method will generate now.
we need to convert string dates before passing to date-fns.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -5,7 +5,8 @@ module.exports = {
{
resourceQuery: /blockType=readme/,
loader: require.resolve('./example/vue-readme-loader')
}
},
{ test: /\.flow$/, loader: 'ignore-loader' }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

Copy link
Author

@nasermirzaei89 nasermirzaei89 Apr 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not an experienced frontend developer. But date-fns v2 have .js.flow files in its locales and WebPack needs a loader for these files.
You can remove this line and try to run yarn example.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

webpack will only process index.js, index.js.flow isn't used.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this line and try to run yarn example.
Webpack will throw an error for this file type.

@Anima-t3d
Copy link

@egoist can this be merged?

@sudofox
Copy link

sudofox commented May 28, 2021

Any news on this? i think the old version of date-fns being used is the reason localization is entirely broken for me here.

@marko-lorentz
Copy link

I would appreciate to see the integration happen, too.
Anything I could do to support this?

@nasermirzaei89
Copy link
Author

The ball is in @egoist ground, but I think they're busy.
We should just wait to see any reaction from their side.
Also others can do further commits if it's required. Because I'm not involved in this pull request anymore.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update to date-fns 2.0
5 participants