-
-
Notifications
You must be signed in to change notification settings - Fork 104
upgrade date-fns to v2 #108
base: master
Are you sure you want to change the base?
Conversation
|
||
export default (date, locale, converterOptions) => { | ||
if (typeof date === 'string') { | ||
date = parseISO(date) |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@egoist can this be merged? |
Any news on this? i think the old version of date-fns being used is the reason localization is entirely broken for me here. |
I would appreciate to see the integration happen, too. |
The ball is in @egoist ground, but I think they're busy. |
fixes #104