@8ms/helpers 1.1.21 → 1.1.24

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.
@@ -23,9 +23,9 @@ var getDate = function (_a) {
23
23
  var day = Number(dateString.substring(6, 8));
24
24
  if (year > 999 && month < 13 && day < 32) {
25
25
  date = new Date();
26
- date.setUTCFullYear(year);
27
- date.setUTCMonth(month - 1);
28
- date.setUTCDate(day);
26
+ date.setFullYear(year);
27
+ date.setMonth(month - 1);
28
+ date.setDate(day);
29
29
  }
30
30
  }
31
31
  // 2022-04-12
@@ -18,20 +18,20 @@ var getFinancialYear = function (_a) {
18
18
  if (undefined === year) {
19
19
  var today = (0, getToday_1.default)();
20
20
  // If today is before 1st of April, then use last year
21
- if (today < new Date(today.getUTCFullYear(), 3, 1)) {
22
- financialYear = today.getUTCFullYear() - 1;
21
+ if (today < new Date(today.getFullYear(), 3, 1)) {
22
+ financialYear = today.getFullYear() - 1;
23
23
  }
24
24
  // On or after 1st of April, use this year
25
25
  else {
26
- financialYear = today.getUTCFullYear();
26
+ financialYear = today.getFullYear();
27
27
  }
28
28
  }
29
29
  // The year-end needs to be 31st March next year
30
30
  var yearEnd = new Date("".concat(financialYear + 1, "-03-31"));
31
- yearEnd.setUTCHours(0, 0, 0, 0);
31
+ yearEnd.setHours(0, 0, 0, 0);
32
32
  // The year start needs to be 1st April this year
33
33
  var yearStart = new Date("".concat(financialYear, "-04-01"));
34
- yearStart.setUTCHours(0, 0, 0, 0);
34
+ yearStart.setHours(0, 0, 0, 0);
35
35
  // Get the previous Monday if the 1st of April isn't a Monday
36
36
  if (!(0, isMonday_1.default)(yearStart)) {
37
37
  yearStart = (0, previousMonday_1.default)(yearStart);
@@ -1,6 +1,5 @@
1
1
  /**
2
2
  * Shortcut to get today's date.
3
- * Set to 1am to prevent daylight savings causing issues
4
3
  */
5
4
  declare const getToday: () => Date;
6
5
  export default getToday;
@@ -2,11 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  /**
4
4
  * Shortcut to get today's date.
5
- * Set to 1am to prevent daylight savings causing issues
6
5
  */
7
6
  var getToday = function () {
8
7
  var today = new Date();
9
- today.setUTCHours(0, 0, 0, 0);
8
+ today.setHours(0, 0, 0, 0);
10
9
  return today;
11
10
  };
12
11
  exports.default = getToday;
package/package.json CHANGED
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
- "sideEffects": false,
4
- "version": "1.1.21",
3
+ "version": "1.1.24",
5
4
  "repository": {
6
5
  "type": "git",
7
6
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"