You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: correct implementation of `createAppointment`
Makes the suggested implementation of `createAppointment` correctly handle appointment creations that
cross timezones - e.g. due to Daylight Savings Time.
re: https://forum.exercism.org/t/tests-and-suggested-implementation-for-appointment-time-are-wrong/
* fix: correct tests for `createAppointment`
Corrects the test so that they respect locales with Daylight Savings Time.
Previously, tests and suggested implementation simply did simple time arithmetic based on the offset
provided to `createAppointment`. This is wrong, as it will shift appointment time-of-day when moving
accross DST boundaries. This changes test implementation so that:
1. correct usage of input times is checked, by passing a 0 offset
2. correct offsetting of appointment time is checked, by passing in a known start date and then
creating one appointment that is within the same DST state and one that is not.
re: https://forum.exercism.org/t/tests-and-suggested-implementation-for-appointment-time-are-wrong/
* docs: update hints
* chore: update contributors
* style: prettier
* docs: refer to instructions for going about getter method
Co-authored-by: Cool-Katt <[email protected]>
* docs: more concise hint about setters
Co-authored-by: Cool-Katt <[email protected]>
* Format all the things
---------
Co-authored-by: Cool-Katt <[email protected]>
Co-authored-by: Derk-Jan Karrenbeld <[email protected]>
Copy file name to clipboardExpand all lines: exercises/concept/appointment-time/.docs/hints.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,8 @@
4
4
5
5
- You need to create a new date. The introduction elaborates on the different ways.
6
6
-`Date.now()` gives you current time in milliseconds
7
-
- A day consist of 24 hour. An hour consist of 60 minutes. A minute consist of 60 seconds. A second consist of 1000 milliseconds. In order to get timestamp of `n` days later from current date, you can sum current timestamp and `n * 24 * 60 * 60 * 1000`.
7
+
-`Date` has several getter methods, listed in the introduction, to get date components. Can you use one of those methods?
8
+
- Likewise, `Date` has matching setter methods to set those components, rolling over into "higher" components if needed.
0 commit comments