improve date query parsing (#1992)#2296
Merged
zomars merged 3 commits intocalcom:mainfrom Mar 28, 2022
Merged
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). docs – ./apps/docs🔍 Inspect: https://vercel.com/cal/docs/FYKGVivqcXYqrspbTmDM6JYKRay9 [Deployment for 33b0da1 canceled] calendso – ./apps/web🔍 Inspect: https://vercel.com/cal/calendso/AmKhqb1Ac4Zc3MFJjZEzsKv7Hjsr [Deployment for 33b0da1 failed] |
|
@buschco is attempting to deploy a commit to the cal Team on Vercel. A member of the Team first needs to authorize it. |
Member
1 task
zomars
reviewed
Mar 28, 2022
| dateString.substr(10, 1) + (utcOffsetAsDate.hour() * 60 + utcOffsetAsDate.minute()) | ||
| ); | ||
| const date = dayjs(dateString.substr(0, 10)).utcOffset(utcOffset, true); | ||
| const offsetString = dateString.substr(11, 14); // hhmm |
Contributor
Contributor
Author
There was a problem hiding this comment.
yeah you are right. I didn't want to change to much of the code, since substring is not a 1:1 replacement for substr
👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Creating a new dayjs date, shows an offset of
2 hourswhats makes sense rn since i live in Europe/Berlin Summer Time:GMT+0200
However, creating the date withdayjs(dateString.substr(11, 14), "Hmm");` will not work as expected (codesandbox playground):Correct me If i am wrong, but using dayjs to parse this string could be the issue here, so I wrote it w/o dayjs.
Could fix #1992 and #2250
Type of change
How should this be tested?
Checklist