Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

refactor: replaced moment with dayjs #126

Merged
merged 3 commits into from
May 16, 2019
Merged

refactor: replaced moment with dayjs #126

merged 3 commits into from
May 16, 2019

Conversation

GoPro16
Copy link
Contributor

@GoPro16 GoPro16 commented Mar 29, 2019

BREAKING CHANGE: moment has been replaced

All of the existing tests that cover the date validation work. The only downside is that we will have to release as a BREAKING CHANGE since some users can rely upon moment in other areas of their projects since its a required dep here.

closes #125

BREAKING CHANGE: moment has been replaced
@netlify
Copy link

netlify bot commented Mar 29, 2019

Deploy preview for availity-reactstrap-validation ready!

Built with commit fbc7b66

https://deploy-preview-126--availity-reactstrap-validation.netlify.com

package.json Outdated Show resolved Hide resolved
@TheSharpieOne
Copy link
Collaborator

TheSharpieOne commented Mar 29, 2019

I don't think this is a breaking change. We don't expose the underlying date library. It doesn't change the API this library exposes or it's usage/results. If someone is depending on something without it being in their owns deps... then that is their fault.

@GoPro16
Copy link
Contributor Author

GoPro16 commented Apr 1, 2019

For some reason dayjs customParseFormat is able to parse an invalid parse format to a valid date.

it('should ensure the format matches the customized format', () => {
expect(fn('10/12/2014', context, {format: 'YYYY-MM-DD'}, input)).to.equal('Format needs to be YYYY-MM-DD');
});

it('should ensure the format matches the customized format', () => {
expect(fn('10/12/2014', context, {format: 'YYYY-MM-DD'}, input)).to.equal('Format needs to be YYYY-MM-DD');
});

Passing in 10/12/2014 with parse format of YYYY-MM-DD results in the valid date of 08-14-2015

Not sure why this is happening but I am going to open an issue on dayjs for this.

@GoPro16
Copy link
Contributor Author

GoPro16 commented Apr 2, 2019

Created issue here: iamkun/dayjs#555

@robmcguinness
Copy link
Contributor

@GoPro16 GoPro16 merged commit 7f11bbf into master May 16, 2019
@GoPro16 GoPro16 deleted the replace/moment branch May 16, 2019 02:46
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.

Swap moment with dayjs
4 participants