This commit is contained in:
Ilya Kantor 2019-11-06 20:28:04 +03:00
parent 2aedc2df49
commit ecd93e97b3
2 changed files with 10 additions and 3 deletions

View file

@ -33,6 +33,13 @@ To create a new `Date` object call `new Date()` with one of the following argume
It's a lightweight numeric representation of a date. We can always create a date from a timestamp using `new Date(timestamp)` and convert the existing `Date` object to a timestamp using the `date.getTime()` method (see below). It's a lightweight numeric representation of a date. We can always create a date from a timestamp using `new Date(timestamp)` and convert the existing `Date` object to a timestamp using the `date.getTime()` method (see below).
Dates before 01.01.1970 have negative timestamps, e.g.:
```js run
// 31 Dec 1969
let Dec31_1969 = new Date(-24 * 3600 * 1000);
alert( Dec31_1969 );
```
`new Date(datestring)` `new Date(datestring)`
: If there is a single argument, and it's a string, then it is parsed automatically. The algorithm is the same as `Date.parse` uses, we'll cover it later. : If there is a single argument, and it's a string, then it is parsed automatically. The algorithm is the same as `Date.parse` uses, we'll cover it later.

View file

@ -21,6 +21,9 @@ The most used simple events are:
`mousemove` `mousemove`
: Every mouse move over an element triggers that event. : Every mouse move over an element triggers that event.
`contextmenu`
: Triggers when opening a context menu is attempted. In the most common case, that happens when the right mouse button is pressed. Although, there are other ways to open a context menu, e.g. using a special keyboard key, so it's not exactly the mouse event.
...There are several other event types too, we'll cover them later. ...There are several other event types too, we'll cover them later.
### Complex events ### Complex events
@ -28,9 +31,6 @@ The most used simple events are:
`click` `click`
: Triggers after `mousedown` and then `mouseup` over the same element if the left mouse button was used. : Triggers after `mousedown` and then `mouseup` over the same element if the left mouse button was used.
`contextmenu`
: Triggers after `mousedown` if the right mouse button was used.
`dblclick` `dblclick`
: Triggers after a double click over an element. : Triggers after a double click over an element.