@8ms/helpers 2.0.36 → 2.0.37

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.
Binary file
package/date/format.d.ts CHANGED
@@ -33,6 +33,11 @@ export declare const getFullDateTime: (input: InputDate) => string;
33
33
  * Example: 1901-02-03 → Feb 1901
34
34
  */
35
35
  export declare const getMonthYearString: (input: InputDate) => string;
36
+ /**
37
+ * Returns a YYYY MMM value as a number for a given year.
38
+ * Example: 1901-02-03 → 1901 Feb
39
+ */
40
+ export declare const getYearMonthString: (input: InputDate) => string;
36
41
  /**
37
42
  * Shorthand to get the current date.
38
43
  */
package/date/format.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseExcelDate = exports.getYmdString = exports.getYmdNumber = exports.getYmdHisString = exports.getYmdHisNumber = exports.getYearNumber = exports.getTodayYmdHisNumber = exports.getTodayYmdNumber = exports.getTodayYmdHisString = exports.getTodayYmdString = exports.getMonthYearString = exports.getFullDateTime = exports.getFullDate = exports.getDayNumber = exports.format = exports.getDurationMinutes = exports.getDurationHours = void 0;
3
+ exports.parseExcelDate = exports.getYmdString = exports.getYmdNumber = exports.getYmdHisString = exports.getYmdHisNumber = exports.getYearNumber = exports.getTodayYmdHisNumber = exports.getTodayYmdNumber = exports.getTodayYmdHisString = exports.getTodayYmdString = exports.getYearMonthString = exports.getMonthYearString = exports.getFullDateTime = exports.getFullDate = exports.getDayNumber = exports.format = exports.getDurationMinutes = exports.getDurationHours = void 0;
4
4
  const calculation_1 = require("./calculation");
5
5
  const luxon_1 = require("luxon");
6
6
  /**
@@ -73,7 +73,7 @@ exports.getFullDate = getFullDate;
73
73
  * Example: 1901-02-03 01:23:45 → 1:23am 3 Feb 1901
74
74
  */
75
75
  const getFullDateTime = (input) => {
76
- return (0, exports.format)(input, "d MMM yyyy h:mmaaa");
76
+ return (0, exports.format)(input, "d MMM yyyy h:mm:ss");
77
77
  };
78
78
  exports.getFullDateTime = getFullDateTime;
79
79
  /**
@@ -84,6 +84,14 @@ const getMonthYearString = (input) => {
84
84
  return (0, exports.format)(input, "MMM yyyy");
85
85
  };
86
86
  exports.getMonthYearString = getMonthYearString;
87
+ /**
88
+ * Returns a YYYY MMM value as a number for a given year.
89
+ * Example: 1901-02-03 → 1901 Feb
90
+ */
91
+ const getYearMonthString = (input) => {
92
+ return (0, exports.format)(input, "yyyy MMM");
93
+ };
94
+ exports.getYearMonthString = getYearMonthString;
87
95
  /**
88
96
  * Shorthand to get the current date.
89
97
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "2.0.36",
4
+ "version": "2.0.37",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"