-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2023-08-30] [$1000] Date is incorrect after editing money request #25441
Comments
Triggered auto assignment to @stephanieelliott ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~0154a57cff1cce910b |
Current assignee @stephanieelliott is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ArekChr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.After editing a money request the date is incorrect What is the root cause of that problem?The root cause is that we are using TransactionUtils.getCreated to get the date and in that function we transform the string representing the date to a date object using new Date(). In javascript using new Date without the time can make the date component not use the local timezone (the timezone depends of the format) which can result in having a day off. What changes do you think we should make in order to solve the problem?We can use the method parseISO of date-fns to parse the date like this
What alternative solutions did you explore? (Optional)We can add the time behind the date like this |
Wow nice @ShogunFire
I think this is interesting but just curios if there is anything else we can use without some special treatment. Is there some param we can pass to the Date() maybe? Or use something from the date-fns? cc @waterim |
@ShogunFire can you please provide the string which is going to the new Date()? |
@ShogunFire you can try date-fns format() function to format the string |
I think its |
@waterim already we are formatting https://github.com/Expensify/App/blob/main/src/libs/TransactionUtils.js?#L176 |
I am trying with parse from date-fns |
@ShogunFire you can try to convert to UTC and after add an offset, or just with date-fns-tz use a UTCtoTimezone function |
Ok so the parse function works well for date alone but in some cases it looks like we also have the time so it fails to parse, Maybe we can try two times to parse ? Like if it fails for date alone we try with the other format EDIT: Trying with parseISO |
can any one clarify me |
ProposalSeems to work well with parseISO method |
@pradeepmdk The date that comes from the api is the date that we sent to the api so it is supposed to be local, the issue is it's not |
@ShogunFire yes, parsoISO is nice one, to prevent any local offsets adding |
ProposalPlease re-state the problem that we are trying to solve in this issue.Date is incorrect after editing money request What is the root cause of that problem?I think the way we're designing the editing of the money request is not ideal. Let's say when I select Let's say when I'm in timezone Then I move to timezone So when we're storing any date, the correct and robust way to do it is to either:
This ambiguity in the time stored causes this issue. Since when we gets the date from the database, it has no timezone so in here, the What changes do you think we should make in order to solve the problem?
For example, if I select
What alternative solutions did you explore? (Optional)NA |
Friendly bump @JmillsExpensify |
@JmillsExpensify, @ShogunFire, @ArekChr, @mountiny Eep! 4 days overdue now. Issues have feelings too... |
Confirming that the payment due to @ShogunFire (Pierre M) is $1500 here, correct? @JmillsExpensify @mountiny? |
@JmillsExpensify, @ShogunFire, @ArekChr, @mountiny Still overdue 6 days?! Let's take care of this! |
@sophiepintoraetz that is correct, thanks for helping |
Payment done - is there anything else keeping this issue open? |
Ah so sorry for the delay on this one. Don't hesitate to reach out to me via New Expensify DM. |
In any case, @ArekChr I don't see a BZ checklist completed for this issue? Do you mind completing one, including whether a regression test is required? Thank you! |
|
Great thank you! All done here. |
cc @mountiny
Action Performed:
Save
Expected Result:
Date is correct
Actual Result:
Date is incorrect
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number:
Reproducible in staging?:
Reproducible in production?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:
View all open jobs on GitHub
Screen.Recording.2023-08-17.at.5.05.01.PM.mov
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: