-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use luxon #519
base: master
Are you sure you want to change the base?
Use luxon #519
Conversation
Hi @robinvrd! Thank you for your work! Wondering, could it be config option to use? Instead of dropping of moment-js just replacing moment to luxon looks like huge breaking change, and that's MR is not merged or reviewed (likely)
|
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.
lgtm
@theme="dark-theme" | ||
@onSelection={{action "doSomethingWithSelectedValue"}} | ||
<PikadayInput | ||
@format="cccc LLLL d yyyy, h:mm:ss a" |
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.
no need
<PikadayInput | ||
@value={{this.startDate}} | ||
@onSelection={{action (mut this.startDate)}} | ||
@format="dd.LL.yyyy" |
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.
no need
@@ -172,7 +174,7 @@ module('Integration | Component | pikaday-input', function(hooks) { | |||
|
|||
test('format of the input is changeable', async function(assert) { | |||
this.set('value', new Date(2010, 7, 10)); | |||
this.set('format', 'YYYY.DD.MM'); | |||
this.set('format', 'yyyy.dd.LL'); |
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.
no need
Althought moment.js works well with pikaday.js, it is now deprecated and has to be replaced with an alternative like
luxon
(basically its successor from same team).Packages installation
ember-auto-import
(andwebpack
) were necessary to useluxon
testdouble
was causing troubles withwebpack
and its use was pretty basic (so replaceable)ember-cli-babel
was causing issues withwebpack
Changes
luxon
follows ISO weekdays order so we had to change all aboutfirstDay
as Monday is now 0 (and not 1)luxon
uses other formatting tokens so we had to change all aboutformat
(https://moment.github.io/luxon/docs/manual/formatting.html#table-of-tokens)moment.js
but not withluxon
, we had to use pikaday methodstoString
andparse
(https://github.com/Pikaday/Pikaday#formatting)