-
Notifications
You must be signed in to change notification settings - Fork 342
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
parseDate is incorrect for these inputs #552
Comments
Hello. I'm sorry for not getting back to you sooner.
Without the context, the default behavior is guessing the Friday closest to the reference date. Would specifying
Do you mean, in addition to the timezone abbreviations, the library use also recognizes the timezone IDs (e.g. "America/New_York", "Europe/London")? It is possible to add that. I'll add that to the todo list. |
Yes, if you could rely on a library that always has the updated IANA time zone database, that would be great. https://en.wikipedia.org/wiki/List_of_tz_database_time_zones Location-based time zones are helpful especially because Daylight Saving is confusing and changes multiple times per year and then even gets redefined occasionally. But if you know where someone is, then you should always be able to convert to their datetime without needing to ask what season it is and whether laws have changed. As for
I hadn't looked into the implementation yet and couldn't tell from the docs whether this is what I want. I now see it at https://github.com/wanasit/chrono/blob/22b831cd87fe625b0a392fd94848e2a0050d08a0/src/common/refiners/ForwardDateRefiner.ts So far, my app has always been calling But since I always want "Fri 11am" to mean "Fri in the future 11am" and always want "March 12" to mean "March 12 in the future", it sounds like I should always use And that requires that I pass a reference date? So I should always pass the current moment as the reference date? Thanks. |
Sorry for my slow reply.
Yes. You can just pass the current time or --
Thanks for sharing. |
Thanks! |
Hello, that would be extremely useful. As possible hints, dayjs with the plugins utc and timezone offers great support for timezone operations, including complex cases where reference Date is in standard time, but the result would be in Daylight Saving Time (like adding 2 weeks from a winter time ). My perception is that the This is very probably way too simplifying. I am ready to help on this, but looked at the code and I feel it is too far reaching for me as it may imply modifiying lots of files Best regards |
Thank you so much for this library!
I've spent hours looking for a solution, and this is the best I've found. 🎉
It handles most of my use cases.
However, here are some that it didn't handle as I'd hope:
https://stackoverflow.com/questions/78464929/js-version-of-phps-strtotime-to-parse-string-inputs-of-unknown-formats-and-conv
The text was updated successfully, but these errors were encountered: