Closed prestonlimlianjie closed 2 years ago
This PR fixes a bug that makes calculations involving date field produce inconsistent results.
Closes https://github.com/opengovsg/checkfirst/issues/1253
This PR sets the default values for the datefield component to be at midnight of the displayed date. The fix is applied to two places
reset()
BEFORE:
https://user-images.githubusercontent.com/19917616/154448271-cbf0e481-acc2-487f-aaaa-24944651c265.mov
AFTER:
https://user-images.githubusercontent.com/19917616/154448261-5b25b03f-4e24-493b-b3dd-84bff8c8e79e.mov
3 tests described in https://github.com/opengovsg/checkfirst/issues/1253
Problem
This PR fixes a bug that makes calculations involving date field produce inconsistent results.
Closes https://github.com/opengovsg/checkfirst/issues/1253
Solution
This PR sets the default values for the datefield component to be at midnight of the displayed date. The fix is applied to two places
reset()
methodBefore & After Videos
BEFORE:
https://user-images.githubusercontent.com/19917616/154448271-cbf0e481-acc2-487f-aaaa-24944651c265.mov
AFTER:
https://user-images.githubusercontent.com/19917616/154448261-5b25b03f-4e24-493b-b3dd-84bff8c8e79e.mov
Tests
3 tests described in https://github.com/opengovsg/checkfirst/issues/1253