@bemoje/date 0.3.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/README.md +94 -20
  2. package/index.d.ts +90 -0
  3. package/index.mjs +112 -0
  4. package/package.json +23 -16
  5. package/LICENSE +0 -21
  6. package/cjs/index.d.ts +0 -38
  7. package/cjs/index.d.ts.map +0 -1
  8. package/cjs/index.js +0 -41
  9. package/cjs/index.js.map +0 -1
  10. package/cjs/lib/assertValidDate.d.ts +0 -19
  11. package/cjs/lib/assertValidDate.d.ts.map +0 -1
  12. package/cjs/lib/assertValidDate.js +0 -36
  13. package/cjs/lib/assertValidDate.js.map +0 -1
  14. package/cjs/lib/assertValidDateDay.d.ts +0 -16
  15. package/cjs/lib/assertValidDateDay.d.ts.map +0 -1
  16. package/cjs/lib/assertValidDateDay.js +0 -24
  17. package/cjs/lib/assertValidDateDay.js.map +0 -1
  18. package/cjs/lib/assertValidDateMonth.d.ts +0 -13
  19. package/cjs/lib/assertValidDateMonth.d.ts.map +0 -1
  20. package/cjs/lib/assertValidDateMonth.js +0 -21
  21. package/cjs/lib/assertValidDateMonth.js.map +0 -1
  22. package/cjs/lib/assertValidDateYear.d.ts +0 -14
  23. package/cjs/lib/assertValidDateYear.d.ts.map +0 -1
  24. package/cjs/lib/assertValidDateYear.js +0 -22
  25. package/cjs/lib/assertValidDateYear.js.map +0 -1
  26. package/cjs/lib/constants/DAYS_IN_MONTH.d.ts +0 -5
  27. package/cjs/lib/constants/DAYS_IN_MONTH.d.ts.map +0 -1
  28. package/cjs/lib/constants/DAYS_IN_MONTH.js +0 -8
  29. package/cjs/lib/constants/DAYS_IN_MONTH.js.map +0 -1
  30. package/cjs/lib/constants/MS_IN_DAY.d.ts +0 -5
  31. package/cjs/lib/constants/MS_IN_DAY.d.ts.map +0 -1
  32. package/cjs/lib/constants/MS_IN_DAY.js +0 -8
  33. package/cjs/lib/constants/MS_IN_DAY.js.map +0 -1
  34. package/cjs/lib/constants/MS_IN_HOUR.d.ts +0 -5
  35. package/cjs/lib/constants/MS_IN_HOUR.d.ts.map +0 -1
  36. package/cjs/lib/constants/MS_IN_HOUR.js +0 -8
  37. package/cjs/lib/constants/MS_IN_HOUR.js.map +0 -1
  38. package/cjs/lib/constants/MS_IN_MINUTE.d.ts +0 -5
  39. package/cjs/lib/constants/MS_IN_MINUTE.d.ts.map +0 -1
  40. package/cjs/lib/constants/MS_IN_MINUTE.js +0 -8
  41. package/cjs/lib/constants/MS_IN_MINUTE.js.map +0 -1
  42. package/cjs/lib/constants/MS_IN_MONTH.d.ts +0 -5
  43. package/cjs/lib/constants/MS_IN_MONTH.d.ts.map +0 -1
  44. package/cjs/lib/constants/MS_IN_MONTH.js +0 -8
  45. package/cjs/lib/constants/MS_IN_MONTH.js.map +0 -1
  46. package/cjs/lib/constants/MS_IN_SECOND.d.ts +0 -5
  47. package/cjs/lib/constants/MS_IN_SECOND.d.ts.map +0 -1
  48. package/cjs/lib/constants/MS_IN_SECOND.js +0 -8
  49. package/cjs/lib/constants/MS_IN_SECOND.js.map +0 -1
  50. package/cjs/lib/constants/MS_IN_WEEK.d.ts +0 -5
  51. package/cjs/lib/constants/MS_IN_WEEK.d.ts.map +0 -1
  52. package/cjs/lib/constants/MS_IN_WEEK.js +0 -8
  53. package/cjs/lib/constants/MS_IN_WEEK.js.map +0 -1
  54. package/cjs/lib/constants/MS_IN_YEAR.d.ts +0 -5
  55. package/cjs/lib/constants/MS_IN_YEAR.d.ts.map +0 -1
  56. package/cjs/lib/constants/MS_IN_YEAR.js +0 -8
  57. package/cjs/lib/constants/MS_IN_YEAR.js.map +0 -1
  58. package/cjs/lib/dateAdjustHoursBy.d.ts +0 -8
  59. package/cjs/lib/dateAdjustHoursBy.d.ts.map +0 -1
  60. package/cjs/lib/dateAdjustHoursBy.js +0 -14
  61. package/cjs/lib/dateAdjustHoursBy.js.map +0 -1
  62. package/cjs/lib/dateCreateTimeZoneSetter.d.ts +0 -7
  63. package/cjs/lib/dateCreateTimeZoneSetter.d.ts.map +0 -1
  64. package/cjs/lib/dateCreateTimeZoneSetter.js +0 -16
  65. package/cjs/lib/dateCreateTimeZoneSetter.js.map +0 -1
  66. package/cjs/lib/dateDaysAgo.d.ts +0 -6
  67. package/cjs/lib/dateDaysAgo.d.ts.map +0 -1
  68. package/cjs/lib/dateDaysAgo.js +0 -14
  69. package/cjs/lib/dateDaysAgo.js.map +0 -1
  70. package/cjs/lib/dateWeekDayName.d.ts +0 -12
  71. package/cjs/lib/dateWeekDayName.d.ts.map +0 -1
  72. package/cjs/lib/dateWeekDayName.js +0 -19
  73. package/cjs/lib/dateWeekDayName.js.map +0 -1
  74. package/cjs/lib/daysSinceDate.d.ts +0 -13
  75. package/cjs/lib/daysSinceDate.d.ts.map +0 -1
  76. package/cjs/lib/daysSinceDate.js +0 -21
  77. package/cjs/lib/daysSinceDate.js.map +0 -1
  78. package/cjs/lib/getCentury.d.ts +0 -14
  79. package/cjs/lib/getCentury.d.ts.map +0 -1
  80. package/cjs/lib/getCentury.js +0 -22
  81. package/cjs/lib/getCentury.js.map +0 -1
  82. package/cjs/lib/getCurrentYear.d.ts +0 -33
  83. package/cjs/lib/getCurrentYear.d.ts.map +0 -1
  84. package/cjs/lib/getCurrentYear.js +0 -47
  85. package/cjs/lib/getCurrentYear.js.map +0 -1
  86. package/cjs/lib/hoursSinceDate.d.ts +0 -13
  87. package/cjs/lib/hoursSinceDate.d.ts.map +0 -1
  88. package/cjs/lib/hoursSinceDate.js +0 -21
  89. package/cjs/lib/hoursSinceDate.js.map +0 -1
  90. package/cjs/lib/isLeapYear.d.ts +0 -16
  91. package/cjs/lib/isLeapYear.d.ts.map +0 -1
  92. package/cjs/lib/isLeapYear.js +0 -24
  93. package/cjs/lib/isLeapYear.js.map +0 -1
  94. package/cjs/lib/isValidDate.d.ts +0 -21
  95. package/cjs/lib/isValidDate.d.ts.map +0 -1
  96. package/cjs/lib/isValidDate.js +0 -41
  97. package/cjs/lib/isValidDate.js.map +0 -1
  98. package/cjs/lib/isValidDateDay.d.ts +0 -17
  99. package/cjs/lib/isValidDateDay.d.ts.map +0 -1
  100. package/cjs/lib/isValidDateDay.js +0 -34
  101. package/cjs/lib/isValidDateDay.js.map +0 -1
  102. package/cjs/lib/isValidDateMonth.d.ts +0 -13
  103. package/cjs/lib/isValidDateMonth.d.ts.map +0 -1
  104. package/cjs/lib/isValidDateMonth.js +0 -19
  105. package/cjs/lib/isValidDateMonth.js.map +0 -1
  106. package/cjs/lib/isValidDateYear.d.ts +0 -16
  107. package/cjs/lib/isValidDateYear.d.ts.map +0 -1
  108. package/cjs/lib/isValidDateYear.js +0 -22
  109. package/cjs/lib/isValidDateYear.js.map +0 -1
  110. package/cjs/lib/isoDateTimestamp.d.ts +0 -16
  111. package/cjs/lib/isoDateTimestamp.d.ts.map +0 -1
  112. package/cjs/lib/isoDateTimestamp.js +0 -22
  113. package/cjs/lib/isoDateTimestamp.js.map +0 -1
  114. package/cjs/lib/isoDateTimestampForFilename.d.ts +0 -12
  115. package/cjs/lib/isoDateTimestampForFilename.d.ts.map +0 -1
  116. package/cjs/lib/isoDateTimestampForFilename.js +0 -21
  117. package/cjs/lib/isoDateTimestampForFilename.js.map +0 -1
  118. package/cjs/lib/minutesSinceDate.d.ts +0 -13
  119. package/cjs/lib/minutesSinceDate.d.ts.map +0 -1
  120. package/cjs/lib/minutesSinceDate.js +0 -21
  121. package/cjs/lib/minutesSinceDate.js.map +0 -1
  122. package/cjs/lib/monthNameDa.d.ts +0 -17
  123. package/cjs/lib/monthNameDa.d.ts.map +0 -1
  124. package/cjs/lib/monthNameDa.js +0 -43
  125. package/cjs/lib/monthNameDa.js.map +0 -1
  126. package/cjs/lib/monthNameEn.d.ts +0 -17
  127. package/cjs/lib/monthNameEn.d.ts.map +0 -1
  128. package/cjs/lib/monthNameEn.js +0 -43
  129. package/cjs/lib/monthNameEn.js.map +0 -1
  130. package/cjs/lib/monthsSinceDate.d.ts +0 -13
  131. package/cjs/lib/monthsSinceDate.d.ts.map +0 -1
  132. package/cjs/lib/monthsSinceDate.js +0 -21
  133. package/cjs/lib/monthsSinceDate.js.map +0 -1
  134. package/cjs/lib/msSinceDate.d.ts +0 -12
  135. package/cjs/lib/msSinceDate.d.ts.map +0 -1
  136. package/cjs/lib/msSinceDate.js +0 -24
  137. package/cjs/lib/msSinceDate.js.map +0 -1
  138. package/cjs/lib/numDaysInMonth.d.ts +0 -18
  139. package/cjs/lib/numDaysInMonth.d.ts.map +0 -1
  140. package/cjs/lib/numDaysInMonth.js +0 -28
  141. package/cjs/lib/numDaysInMonth.js.map +0 -1
  142. package/cjs/lib/prettyIsoDateString.d.ts +0 -14
  143. package/cjs/lib/prettyIsoDateString.d.ts.map +0 -1
  144. package/cjs/lib/prettyIsoDateString.js +0 -29
  145. package/cjs/lib/prettyIsoDateString.js.map +0 -1
  146. package/cjs/lib/secondsSinceDate.d.ts +0 -11
  147. package/cjs/lib/secondsSinceDate.d.ts.map +0 -1
  148. package/cjs/lib/secondsSinceDate.js +0 -19
  149. package/cjs/lib/secondsSinceDate.js.map +0 -1
  150. package/cjs/lib/weeksSinceDate.d.ts +0 -11
  151. package/cjs/lib/weeksSinceDate.d.ts.map +0 -1
  152. package/cjs/lib/weeksSinceDate.js +0 -19
  153. package/cjs/lib/weeksSinceDate.js.map +0 -1
  154. package/cjs/lib/yearsSinceDate.d.ts +0 -11
  155. package/cjs/lib/yearsSinceDate.d.ts.map +0 -1
  156. package/cjs/lib/yearsSinceDate.js +0 -19
  157. package/cjs/lib/yearsSinceDate.js.map +0 -1
@@ -1,14 +0,0 @@
1
- /**
2
- * Asserts that the provided year is a valid date year.
3
- * @param year The year to be validated
4
- * @throws Will throw an error if the year is not valid.
5
- * @example ```ts
6
- * assertValidDateYear(2020);;
7
- * //=> undefined
8
- * assertValidDateYear(10000);;
9
- * //=> Error: Invalid year: 10000.
10
- * ```
11
- * @returns void
12
- */
13
- export declare function assertValidDateYear(year: number): void;
14
- //# sourceMappingURL=assertValidDateYear.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertValidDateYear.d.ts","sourceRoot":"","sources":["../../../../../packages/date/src/lib/assertValidDateYear.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEtD"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.assertValidDateYear = void 0;
4
- const isValidDateYear_1 = require("./isValidDateYear");
5
- /**
6
- * Asserts that the provided year is a valid date year.
7
- * @param year The year to be validated
8
- * @throws Will throw an error if the year is not valid.
9
- * @example ```ts
10
- * assertValidDateYear(2020);;
11
- * //=> undefined
12
- * assertValidDateYear(10000);;
13
- * //=> Error: Invalid year: 10000.
14
- * ```
15
- * @returns void
16
- */
17
- function assertValidDateYear(year) {
18
- if (!(0, isValidDateYear_1.isValidDateYear)(year))
19
- throw new Error(`Invalid year: ${year}.`);
20
- }
21
- exports.assertValidDateYear = assertValidDateYear;
22
- //# sourceMappingURL=assertValidDateYear.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertValidDateYear.js","sourceRoot":"","sources":["../../../../../packages/date/src/lib/assertValidDateYear.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AAEnD;;;;;;;;;;;GAWG;AACH,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,IAAI,CAAC,IAAA,iCAAe,EAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,GAAG,CAAC,CAAA;AACvE,CAAC;AAFD,kDAEC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * The number of days there are in each month (except leap year).
3
- */
4
- export declare const DAYS_IN_MONTH: number[];
5
- //# sourceMappingURL=DAYS_IN_MONTH.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DAYS_IN_MONTH.d.ts","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/DAYS_IN_MONTH.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,eAAO,MAAM,aAAa,UAAsD,CAAA"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- /**
3
- * The number of days there are in each month (except leap year).
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DAYS_IN_MONTH = void 0;
7
- exports.DAYS_IN_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
8
- //# sourceMappingURL=DAYS_IN_MONTH.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DAYS_IN_MONTH.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/DAYS_IN_MONTH.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEU,QAAA,aAAa,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * The number of milliseconds in a day.
3
- */
4
- export declare const MS_IN_DAY: number;
5
- //# sourceMappingURL=MS_IN_DAY.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_DAY.d.ts","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_DAY.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,SAAS,QAAsB,CAAA"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MS_IN_DAY = void 0;
4
- /**
5
- * The number of milliseconds in a day.
6
- */
7
- exports.MS_IN_DAY = 1000 * 60 * 60 * 24;
8
- //# sourceMappingURL=MS_IN_DAY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_DAY.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_DAY.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,SAAS,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * The number of milliseconds in an hour.
3
- */
4
- export declare const MS_IN_HOUR: number;
5
- //# sourceMappingURL=MS_IN_HOUR.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_HOUR.d.ts","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_HOUR.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,QAAiB,CAAA"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MS_IN_HOUR = void 0;
4
- /**
5
- * The number of milliseconds in an hour.
6
- */
7
- exports.MS_IN_HOUR = 1000 * 60 * 60;
8
- //# sourceMappingURL=MS_IN_HOUR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_HOUR.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_HOUR.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,UAAU,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * The number of milliseconds in a minute.
3
- */
4
- export declare const MS_IN_MINUTE: number;
5
- //# sourceMappingURL=MS_IN_MINUTE.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_MINUTE.d.ts","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_MINUTE.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,QAAY,CAAA"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MS_IN_MINUTE = void 0;
4
- /**
5
- * The number of milliseconds in a minute.
6
- */
7
- exports.MS_IN_MINUTE = 1000 * 60;
8
- //# sourceMappingURL=MS_IN_MINUTE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_MINUTE.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_MINUTE.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,YAAY,GAAG,IAAI,GAAG,EAAE,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * The number of milliseconds in a month.
3
- */
4
- export declare const MS_IN_MONTH: number;
5
- //# sourceMappingURL=MS_IN_MONTH.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_MONTH.d.ts","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_MONTH.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,WAAW,QAAmC,CAAA"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MS_IN_MONTH = void 0;
4
- /**
5
- * The number of milliseconds in a month.
6
- */
7
- exports.MS_IN_MONTH = (1000 * 60 * 60 * 24 * 365) / 12;
8
- //# sourceMappingURL=MS_IN_MONTH.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_MONTH.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_MONTH.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,WAAW,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,GAAG,EAAE,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * The number of milliseconds in a second.
3
- */
4
- export declare const MS_IN_SECOND = 1000;
5
- //# sourceMappingURL=MS_IN_SECOND.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_SECOND.d.ts","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_SECOND.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,OAAO,CAAA"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MS_IN_SECOND = void 0;
4
- /**
5
- * The number of milliseconds in a second.
6
- */
7
- exports.MS_IN_SECOND = 1000;
8
- //# sourceMappingURL=MS_IN_SECOND.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_SECOND.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_SECOND.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,YAAY,GAAG,IAAI,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * The number of milliseconds in a week.
3
- */
4
- export declare const MS_IN_WEEK: number;
5
- //# sourceMappingURL=MS_IN_WEEK.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_WEEK.d.ts","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_WEEK.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,QAA0B,CAAA"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MS_IN_WEEK = void 0;
4
- /**
5
- * The number of milliseconds in a week.
6
- */
7
- exports.MS_IN_WEEK = 1000 * 60 * 60 * 24 * 7;
8
- //# sourceMappingURL=MS_IN_WEEK.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_WEEK.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_WEEK.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,UAAU,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA"}
@@ -1,5 +0,0 @@
1
- /**
2
- * The number of milliseconds in a year.
3
- */
4
- export declare const MS_IN_YEAR: number;
5
- //# sourceMappingURL=MS_IN_YEAR.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_YEAR.d.ts","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_YEAR.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,UAAU,QAA4B,CAAA"}
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MS_IN_YEAR = void 0;
4
- /**
5
- * The number of milliseconds in a year.
6
- */
7
- exports.MS_IN_YEAR = 1000 * 60 * 60 * 24 * 365;
8
- //# sourceMappingURL=MS_IN_YEAR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MS_IN_YEAR.js","sourceRoot":"","sources":["../../../../../../packages/date/src/lib/constants/MS_IN_YEAR.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,UAAU,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA"}
@@ -1,8 +0,0 @@
1
- /**
2
- * Adjusts the given date by the specified number of hours.
3
- * @param date - The date to adjust, represented as an integer or Date instance.
4
- * @param hours - The number of hours. Decimal points and negative values are accepted.
5
- * @returns The adjusted date, represented as a number.
6
- */
7
- export declare function dateAdjustHoursBy(date: number | Date, hours: number): number;
8
- //# sourceMappingURL=dateAdjustHoursBy.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateAdjustHoursBy.d.ts","sourceRoot":"","sources":["../../../../../packages/date/src/lib/dateAdjustHoursBy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5E"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateAdjustHoursBy = void 0;
4
- /**
5
- * Adjusts the given date by the specified number of hours.
6
- * @param date - The date to adjust, represented as an integer or Date instance.
7
- * @param hours - The number of hours. Decimal points and negative values are accepted.
8
- * @returns The adjusted date, represented as a number.
9
- */
10
- function dateAdjustHoursBy(date, hours) {
11
- return Math.floor(date.valueOf() + 1000 * 60 * 60 * hours);
12
- }
13
- exports.dateAdjustHoursBy = dateAdjustHoursBy;
14
- //# sourceMappingURL=dateAdjustHoursBy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateAdjustHoursBy.js","sourceRoot":"","sources":["../../../../../packages/date/src/lib/dateAdjustHoursBy.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,IAAmB,EAAE,KAAa;IAClE,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,CAAC,CAAA;AAC5D,CAAC;AAFD,8CAEC"}
@@ -1,7 +0,0 @@
1
- /**
2
- * Creates a function that adjusts the time zone of a given date object by a specified number of hours.
3
- * @param hours - The distance from UTC time.
4
- * @returns A function that takes a date-instance or date-integer and adjusts it by the given number of hours, and returns it as a date-integer.
5
- */
6
- export declare function dateCreateTimeZoneSetter(hours: number): (date: number | Date) => number;
7
- //# sourceMappingURL=dateCreateTimeZoneSetter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateCreateTimeZoneSetter.d.ts","sourceRoot":"","sources":["../../../../../packages/date/src/lib/dateCreateTimeZoneSetter.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAIvF"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateCreateTimeZoneSetter = void 0;
4
- const dateAdjustHoursBy_1 = require("./dateAdjustHoursBy");
5
- /**
6
- * Creates a function that adjusts the time zone of a given date object by a specified number of hours.
7
- * @param hours - The distance from UTC time.
8
- * @returns A function that takes a date-instance or date-integer and adjusts it by the given number of hours, and returns it as a date-integer.
9
- */
10
- function dateCreateTimeZoneSetter(hours) {
11
- return function setTimeZone(date) {
12
- return (0, dateAdjustHoursBy_1.dateAdjustHoursBy)(date, hours);
13
- };
14
- }
15
- exports.dateCreateTimeZoneSetter = dateCreateTimeZoneSetter;
16
- //# sourceMappingURL=dateCreateTimeZoneSetter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateCreateTimeZoneSetter.js","sourceRoot":"","sources":["../../../../../packages/date/src/lib/dateCreateTimeZoneSetter.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AAEvD;;;;GAIG;AACH,SAAgB,wBAAwB,CAAC,KAAa;IACpD,OAAO,SAAS,WAAW,CAAC,IAAmB;QAC7C,OAAO,IAAA,qCAAiB,EAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACvC,CAAC,CAAA;AACH,CAAC;AAJD,4DAIC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Returns a Date object representing a date that is a certain number of days in the past.
3
- * @param days The number of days ago for the date to represent.
4
- */
5
- export declare function dateDaysAgo(days: number): Date;
6
- //# sourceMappingURL=dateDaysAgo.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateDaysAgo.d.ts","sourceRoot":"","sources":["../../../../../packages/date/src/lib/dateDaysAgo.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAI9C"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateDaysAgo = void 0;
4
- /**
5
- * Returns a Date object representing a date that is a certain number of days in the past.
6
- * @param days The number of days ago for the date to represent.
7
- */
8
- function dateDaysAgo(days) {
9
- const date = new Date();
10
- date.setDate(date.getDate() - days);
11
- return date;
12
- }
13
- exports.dateDaysAgo = dateDaysAgo;
14
- //# sourceMappingURL=dateDaysAgo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateDaysAgo.js","sourceRoot":"","sources":["../../../../../packages/date/src/lib/dateDaysAgo.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,WAAW,CAAC,IAAY;IACtC,MAAM,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;IACvB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAA;IACnC,OAAO,IAAI,CAAA;AACb,CAAC;AAJD,kCAIC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Returns the weekday name of a given date.
3
- *
4
- * @param date - The date object from which the weekday name is to be extracted.
5
- * @returns The weekday name corresponding to the date.
6
- *
7
- * @example
8
- * dateWeekDayName(new Date(2010, 10, 7))
9
- * //=> 'Sunday'
10
- */
11
- export declare function dateWeekDayName(date: Date): string;
12
- //# sourceMappingURL=dateWeekDayName.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateWeekDayName.d.ts","sourceRoot":"","sources":["../../../../../packages/date/src/lib/dateWeekDayName.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,UAEzC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dateWeekDayName = void 0;
4
- /**
5
- * Returns the weekday name of a given date.
6
- *
7
- * @param date - The date object from which the weekday name is to be extracted.
8
- * @returns The weekday name corresponding to the date.
9
- *
10
- * @example
11
- * dateWeekDayName(new Date(2010, 10, 7))
12
- * //=> 'Sunday'
13
- */
14
- function dateWeekDayName(date) {
15
- return names[date.getDay()];
16
- }
17
- exports.dateWeekDayName = dateWeekDayName;
18
- const names = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
19
- //# sourceMappingURL=dateWeekDayName.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dateWeekDayName.js","sourceRoot":"","sources":["../../../../../packages/date/src/lib/dateWeekDayName.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,SAAgB,eAAe,CAAC,IAAU;IACxC,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;AAC7B,CAAC;AAFD,0CAEC;AAED,MAAM,KAAK,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAA"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Calculates the number of days that have passed since the given date.
3
- * @param date The date from which to calculate the number of days passed.
4
- * @returns The number of days since the given date.
5
- * @example ```ts
6
- * new Date('2020-01-01');;
7
- * //=> <date object>
8
- * daysSinceDate(new Date('2020-01-01'));;
9
- * //=> <number of days since 2020-01-01>
10
- * ```
11
- */
12
- export declare function daysSinceDate(date: Date | number): number;
13
- //# sourceMappingURL=daysSinceDate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"daysSinceDate.d.ts","sourceRoot":"","sources":["../../../../../packages/date/src/lib/daysSinceDate.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAEzD"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.daysSinceDate = void 0;
4
- const MS_IN_DAY_1 = require("./constants/MS_IN_DAY");
5
- const msSinceDate_1 = require("./msSinceDate");
6
- /**
7
- * Calculates the number of days that have passed since the given date.
8
- * @param date The date from which to calculate the number of days passed.
9
- * @returns The number of days since the given date.
10
- * @example ```ts
11
- * new Date('2020-01-01');;
12
- * //=> <date object>
13
- * daysSinceDate(new Date('2020-01-01'));;
14
- * //=> <number of days since 2020-01-01>
15
- * ```
16
- */
17
- function daysSinceDate(date) {
18
- return (0, msSinceDate_1.msSinceDate)(date) / MS_IN_DAY_1.MS_IN_DAY;
19
- }
20
- exports.daysSinceDate = daysSinceDate;
21
- //# sourceMappingURL=daysSinceDate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"daysSinceDate.js","sourceRoot":"","sources":["../../../../../packages/date/src/lib/daysSinceDate.ts"],"names":[],"mappings":";;;AAAA,qDAAiD;AACjD,+CAA2C;AAE3C;;;;;;;;;;GAUG;AACH,SAAgB,aAAa,CAAC,IAAmB;IAC/C,OAAO,IAAA,yBAAW,EAAC,IAAI,CAAC,GAAG,qBAAS,CAAA;AACtC,CAAC;AAFD,sCAEC"}
@@ -1,14 +0,0 @@
1
- /**
2
- * This function takes a year as a parameter and returns the century it belongs to.
3
- * @param year The year to determine the century for. Must be a valid year number.
4
- * @returns The century the year belongs to.
5
- * @throws Will throw an error if the year is not a valid number.
6
- * @example ```ts
7
- * getCentury(2000);;
8
- * //=> 20
9
- * getCentury(1899);;
10
- * //=> 19
11
- * ```
12
- */
13
- export declare function getCentury(year: number): number;
14
- //# sourceMappingURL=getCentury.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCentury.d.ts","sourceRoot":"","sources":["../../../../../packages/date/src/lib/getCentury.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAG/C"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCentury = void 0;
4
- const assertValidDateYear_1 = require("./assertValidDateYear");
5
- /**
6
- * This function takes a year as a parameter and returns the century it belongs to.
7
- * @param year The year to determine the century for. Must be a valid year number.
8
- * @returns The century the year belongs to.
9
- * @throws Will throw an error if the year is not a valid number.
10
- * @example ```ts
11
- * getCentury(2000);;
12
- * //=> 20
13
- * getCentury(1899);;
14
- * //=> 19
15
- * ```
16
- */
17
- function getCentury(year) {
18
- (0, assertValidDateYear_1.assertValidDateYear)(year);
19
- return Math.floor(year / 100) + 1;
20
- }
21
- exports.getCentury = getCentury;
22
- //# sourceMappingURL=getCentury.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCentury.js","sourceRoot":"","sources":["../../../../../packages/date/src/lib/getCentury.ts"],"names":[],"mappings":";;;AAAA,+DAA2D;AAE3D;;;;;;;;;;;GAWG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,IAAA,yCAAmB,EAAC,IAAI,CAAC,CAAA;IACzB,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAA;AACnC,CAAC;AAHD,gCAGC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Returns the current year as a number.
3
- * @remarks This function uses the `getUTCFullYear` method of the `Date` object to get the current year.
4
- * @returns The current year as a number.
5
- * @example ```ts
6
- * getCurrentYear();;
7
- * //=> 2022
8
- * ```
9
- */
10
- export declare function getCurrentYear(): number;
11
- /**
12
- * Returns the year as a number between 0 and 9999.
13
- *
14
- * @remarks to use UTC time, use @see getYear.UTC()
15
- *
16
- * @param date If not the current year is wanted, pass a date object to get the year from.
17
- */
18
- export declare function getYear(date?: Date): number;
19
- export declare namespace getYear {
20
- var UTC: (date?: Date) => number;
21
- }
22
- /**
23
- * Returns the month as a number between 1 and 12.
24
- *
25
- * @remarks to use UTC time, use @see getMonth.UTC()
26
- *
27
- * @param date If not the current year is wanted, pass a date object to get the year from.
28
- */
29
- export declare function getMonth(date?: Date): number;
30
- export declare namespace getMonth {
31
- var UTC: (date?: Date) => number;
32
- }
33
- //# sourceMappingURL=getCurrentYear.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCurrentYear.d.ts","sourceRoot":"","sources":["../../../../../packages/date/src/lib/getCurrentYear.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,OAAa,GAAG,MAAM,CAEjD;yBAFe,OAAO;;;AAQvB;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,OAAa,GAAG,MAAM,CAElD;yBAFe,QAAQ"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMonth = exports.getYear = exports.getCurrentYear = void 0;
4
- /**
5
- * Returns the current year as a number.
6
- * @remarks This function uses the `getUTCFullYear` method of the `Date` object to get the current year.
7
- * @returns The current year as a number.
8
- * @example ```ts
9
- * getCurrentYear();;
10
- * //=> 2022
11
- * ```
12
- */
13
- function getCurrentYear() {
14
- return new Date().getUTCFullYear();
15
- }
16
- exports.getCurrentYear = getCurrentYear;
17
- /**
18
- * Returns the year as a number between 0 and 9999.
19
- *
20
- * @remarks to use UTC time, use @see getYear.UTC()
21
- *
22
- * @param date If not the current year is wanted, pass a date object to get the year from.
23
- */
24
- function getYear(date = new Date()) {
25
- return date.getFullYear();
26
- }
27
- exports.getYear = getYear;
28
- getYear.UTC = function getYearUTC(date = new Date()) {
29
- return date.getUTCFullYear();
30
- };
31
- /**
32
- * Returns the month as a number between 1 and 12.
33
- *
34
- * @remarks to use UTC time, use @see getMonth.UTC()
35
- *
36
- * @param date If not the current year is wanted, pass a date object to get the year from.
37
- */
38
- function getMonth(date = new Date()) {
39
- return date.getMonth() + 1;
40
- }
41
- exports.getMonth = getMonth;
42
- getMonth.UTC = function getMonthUTC(date = new Date()) {
43
- return date.getUTCMonth() + 1;
44
- };
45
- // console.log({ year: getYear(), month: getMonth() })
46
- // console.log({ yearUTC: getYear.UTC(), monthUTC: getMonth.UTC() })
47
- //# sourceMappingURL=getCurrentYear.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getCurrentYear.js","sourceRoot":"","sources":["../../../../../packages/date/src/lib/getCurrentYear.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,SAAgB,cAAc;IAC5B,OAAO,IAAI,IAAI,EAAE,CAAC,cAAc,EAAE,CAAA;AACpC,CAAC;AAFD,wCAEC;AAED;;;;;;GAMG;AACH,SAAgB,OAAO,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE;IACvC,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED,OAAO,CAAC,GAAG,GAAG,SAAS,UAAU,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE;IACjD,OAAO,IAAI,CAAC,cAAc,EAAE,CAAA;AAC9B,CAAC,CAAA;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE;IACxC,OAAO,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AAC5B,CAAC;AAFD,4BAEC;AAED,QAAQ,CAAC,GAAG,GAAG,SAAS,WAAW,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE;IACnD,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAA;AAC/B,CAAC,CAAA;AAED,sDAAsD;AACtD,oEAAoE"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Calculates the number of hours that have passed since the given date.
3
- * @param date The date from which to calculate the number of hours passed.
4
- * @returns The number of hours that have passed since the given date.
5
- * @example ```ts
6
- * new Date('2020-01-01T00:00:00Z');;
7
- * //=> {date object}
8
- * hoursSinceDate(new Date('2020-01-01T00:00:00Z'));;
9
- * //=> {number of hours since January 1, 2020}
10
- * ```
11
- */
12
- export declare function hoursSinceDate(date: Date | number): number;
13
- //# sourceMappingURL=hoursSinceDate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hoursSinceDate.d.ts","sourceRoot":"","sources":["../../../../../packages/date/src/lib/hoursSinceDate.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,CAE1D"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hoursSinceDate = void 0;
4
- const MS_IN_HOUR_1 = require("./constants/MS_IN_HOUR");
5
- const msSinceDate_1 = require("./msSinceDate");
6
- /**
7
- * Calculates the number of hours that have passed since the given date.
8
- * @param date The date from which to calculate the number of hours passed.
9
- * @returns The number of hours that have passed since the given date.
10
- * @example ```ts
11
- * new Date('2020-01-01T00:00:00Z');;
12
- * //=> {date object}
13
- * hoursSinceDate(new Date('2020-01-01T00:00:00Z'));;
14
- * //=> {number of hours since January 1, 2020}
15
- * ```
16
- */
17
- function hoursSinceDate(date) {
18
- return (0, msSinceDate_1.msSinceDate)(date) / MS_IN_HOUR_1.MS_IN_HOUR;
19
- }
20
- exports.hoursSinceDate = hoursSinceDate;
21
- //# sourceMappingURL=hoursSinceDate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hoursSinceDate.js","sourceRoot":"","sources":["../../../../../packages/date/src/lib/hoursSinceDate.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AACnD,+CAA2C;AAE3C;;;;;;;;;;GAUG;AACH,SAAgB,cAAc,CAAC,IAAmB;IAChD,OAAO,IAAA,yBAAW,EAAC,IAAI,CAAC,GAAG,uBAAU,CAAA;AACvC,CAAC;AAFD,wCAEC"}