@molochko-dev/data 1.4.108 → 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/dist/index.d.ts CHANGED
@@ -56,5 +56,5 @@ export declare const animalEnums: typeof _animalEnums.enums;
56
56
  export declare const eventEnums: typeof _animalForEventFilters.enums;
57
57
  export declare const eqEnums: typeof _eqEnums.enums;
58
58
  export declare const orgConstants: typeof _orgConstants.constants;
59
- export declare const milkEnums: typeof _milkEnums;
59
+ export declare const milkEnums: typeof _milkEnums.enums;
60
60
  export * as event from './event';
package/dist/index.js CHANGED
@@ -48,7 +48,7 @@ exports.animalEnums = _animalEnums.enums;
48
48
  exports.eventEnums = _eventEnums.enums;
49
49
  exports.eqEnums = _eqEnums.enums;
50
50
  exports.orgConstants = _orgConstants.constants;
51
- exports.milkEnums = _milkEnums;
51
+ exports.milkEnums = _milkEnums.enums;
52
52
  // export { events } from './event';
53
53
  // export type { events as EventType } from './event';
54
54
  exports.event = __importStar(require("./event"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molochko-dev/data",
3
- "version": "1.4.108",
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
+ }
package/src/index.ts CHANGED
@@ -23,7 +23,7 @@ export const animalEnums = _animalEnums.enums;
23
23
  export const eventEnums = _eventEnums.enums;
24
24
  export const eqEnums = _eqEnums.enums
25
25
  export const orgConstants = _orgConstants.constants
26
- export const milkEnums = _milkEnums
26
+ export const milkEnums = _milkEnums.enums
27
27
 
28
28
  // export { events } from './event';
29
29
  // export type { events as EventType } from './event';