@steroidsjs/bootstrap 3.0.34 → 3.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.
@@ -47,9 +47,9 @@ exports.RANGE_BUTTONS = {
47
47
  lastMonth: {
48
48
  label: __('Прошлый месяц'),
49
49
  onClick: function (locale, changeFrom, changeTo, format) {
50
- var _a = (0, utils_1.getCurrentMonth)(locale), start = _a.start, finish = _a.finish;
51
- changeFrom(start.subtract(1, 'month').format(format));
52
- changeTo(finish.subtract(1, 'month').format(format));
50
+ var _a = (0, utils_1.getPreviousMonth)(locale), start = _a.start, finish = _a.finish;
51
+ changeFrom(start.format(format));
52
+ changeTo(finish.format(format));
53
53
  }
54
54
  },
55
55
  thisYear: {
@@ -8,6 +8,10 @@ export declare const getCurrentMonth: (locale: ILocaleComponent) => {
8
8
  start: import("dayjs").Dayjs;
9
9
  finish: import("dayjs").Dayjs;
10
10
  };
11
+ export declare const getPreviousMonth: (locale: ILocaleComponent) => {
12
+ start: import("dayjs").Dayjs;
13
+ finish: import("dayjs").Dayjs;
14
+ };
11
15
  export declare const getCurrentYear: (locale: ILocaleComponent) => {
12
16
  start: import("dayjs").Dayjs;
13
17
  finish: import("dayjs").Dayjs;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  exports.__esModule = true;
3
- exports.getCurrentYear = exports.getCurrentMonth = exports.getCurrentWeek = exports.getEndOfDay = void 0;
3
+ exports.getCurrentYear = exports.getPreviousMonth = exports.getCurrentMonth = exports.getCurrentWeek = exports.getEndOfDay = void 0;
4
4
  var getEndOfDay = function (date) { return date.hour(23).minute(59).second(59); };
5
5
  exports.getEndOfDay = getEndOfDay;
6
6
  var getCurrentWeek = function (locale) {
@@ -24,6 +24,17 @@ var getCurrentMonth = function (locale) {
24
24
  };
25
25
  };
26
26
  exports.getCurrentMonth = getCurrentMonth;
27
+ var getPreviousMonth = function (locale) {
28
+ var today = locale.dayjs(new Date().toDateString());
29
+ var prevMonth = today.subtract(1, 'month');
30
+ var startDate = prevMonth.startOf('month');
31
+ var finishDate = prevMonth.endOf('month');
32
+ return {
33
+ start: startDate,
34
+ finish: (0, exports.getEndOfDay)(finishDate)
35
+ };
36
+ };
37
+ exports.getPreviousMonth = getPreviousMonth;
27
38
  var getCurrentYear = function (locale) {
28
39
  var today = locale.dayjs(new Date().toDateString());
29
40
  var startDate = today.startOf('year');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steroidsjs/bootstrap",
3
- "version": "3.0.34",
3
+ "version": "3.0.37",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "author": "Vladimir Kozhin <hello@kozhindev.com>",
@@ -35,7 +35,7 @@
35
35
  "react-use": "^17.4.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@steroidsjs/core": "3.0.59",
38
+ "@steroidsjs/core": "3.0.67",
39
39
  "@steroidsjs/eslint-config": "^2.1.6",
40
40
  "@types/enzyme": "^3.10.8",
41
41
  "@types/googlemaps": "^3.43.3",