@molochko-dev/data 1.4.109 → 1.4.110

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.
@@ -0,0 +1,5 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="PROJECT_PROFILE" />
4
+ </settings>
5
+ </component>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/molochko-data.iml" filepath="$PROJECT_DIR$/.idea/molochko-data.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
6
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
7
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
8
+ </content>
9
+ <orderEntry type="inheritedJdk" />
10
+ <orderEntry type="sourceFolder" forTests="false" />
11
+ </component>
12
+ </module>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PropertiesComponent">{
4
+ &quot;keyToString&quot;: {
5
+ &quot;settings.editor.selected.configurable&quot;: &quot;preferences.lookFeel&quot;
6
+ }
7
+ }</component>
8
+ </project>
@@ -1 +1,2 @@
1
1
  export declare const getMonthFromDate: (dateString: string) => number;
2
+ export declare function datestrToDate(dateStr: string): Date;
@@ -3,10 +3,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getMonthFromDate = void 0;
6
+ exports.datestrToDate = exports.getMonthFromDate = void 0;
7
7
  const moment_1 = __importDefault(require("moment"));
8
8
  const getMonthFromDate = (dateString) => {
9
9
  const result = (0, moment_1.default)().diff(dateString, 'months');
10
10
  return result;
11
11
  };
12
12
  exports.getMonthFromDate = getMonthFromDate;
13
+ /* преобразование строки 251201 в дату*/
14
+ function datestrToDate(dateStr) {
15
+ const year = '20' + dateStr.substring(0, 2); // 2022
16
+ const month = dateStr.substring(2, 4); // 12
17
+ const day = dateStr.substring(4, 6); // 02
18
+ // Создаем дату (месяцы в JS: 0-11)
19
+ const date = new Date(`${year}-${month}-${day}`);
20
+ return date;
21
+ }
22
+ exports.datestrToDate = datestrToDate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molochko-dev/data",
3
- "version": "1.4.109",
3
+ "version": "1.4.110",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "typings/index.d.ts",
@@ -4,3 +4,14 @@ export const getMonthFromDate = (dateString: string) => {
4
4
  const result = moment().diff(dateString, 'months');
5
5
  return result;
6
6
  };
7
+
8
+ /* преобразование строки 251201 в дату*/
9
+ export function datestrToDate(dateStr: string): Date {
10
+ const year = '20' + dateStr.substring(0, 2); // 2022
11
+ const month = dateStr.substring(2, 4); // 12
12
+ const day = dateStr.substring(4, 6); // 02
13
+
14
+ // Создаем дату (месяцы в JS: 0-11)
15
+ const date = new Date(`${year}-${month}-${day}`);
16
+ return date;
17
+ }