* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
12
*
13
* @param date - The given date
14
*
15
* @returns The year of decade
16
*
17
* @example
18
* // Which decade belongs 27 November 1942?
19
* const result = getDecade(new Date(1942, 10, 27))
20
* //=> 1940
21
*/
22
exportfunctiongetDecade(date) {
23
// TODO: Switch to more technical definition in of decades that start with 1
24
// end with 0. I.e. 2001-2010 instead of current 2000-2009. It's a breaking