Skip to content

Commit 5416b8b

Browse files
committed
hints.md in appointment-time
1 parent 53fc536 commit 5416b8b

File tree

1 file changed

+25
-0
lines changed
  • exercises/concept/appointment-time/.docs

1 file changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Hints
2+
3+
## 1. Create an appointment
4+
5+
- `new Date()` can be used to create new date. You can pass timestamp to create specific date.
6+
- `Date.now()` gives you current timestamp.
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`.
8+
9+
## 2. Get details of an appointment
10+
11+
- Date object has [built-in methods][mdn-date-methods] to get different parts of the date.
12+
13+
## 3. Update an appointment with given options
14+
15+
- Date object has [built-in methods][mdn-date-methods] to modify date.
16+
17+
## 4. Get available times between two appointment
18+
19+
- General subtraction between two dates will give you the timestamp between the two dates.
20+
21+
## 5. Check if an appointment is now valid or not
22+
23+
- Conditional operators will help you to decide which date is bigger or smaller between two dates.
24+
25+
[mdn-date-methods]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#instance_methods

0 commit comments

Comments
 (0)