The Wayback Machine - https://web.archive.org/web/20210105213941/https://github.com/iamkun/dayjs/issues/1027
Skip to content
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

Strict parsing support with UTC plugin #1027

Open
vbatoufflet opened this issue Aug 26, 2020 · 2 comments
Open

Strict parsing support with UTC plugin #1027

vbatoufflet opened this issue Aug 26, 2020 · 2 comments

Comments

@vbatoufflet
Copy link

@vbatoufflet vbatoufflet commented Aug 26, 2020

Hi,

Looking at the dayjs function signature and at the String + Format documentation there is a strict parsing mode using a 3rd (or 4th when using locale) boolean flag:

dayjs(date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean)

Looking at the corresponding UTC plugin, it doesn't seem to have such option available:

dayjs.utc(config?: dayjs.ConfigType, format?: string)

Did I miss something obvious in the documentation?

If not, is it something that's worth be supported in the future?

Thanks!

@homoky
Copy link

@homoky homoky commented Oct 9, 2020

That would be a great upgrade. We use only utc() version so this would simplify our codebase.

@iamkun
Copy link
Owner

@iamkun iamkun commented Oct 13, 2020

Seems UTC plugin supports strict parsing already, all we have to do is to update the docs and the ts type file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.