ublo-lib 1.39.31 → 1.39.33
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.
- package/es/common/components/date-picker/data.d.ts +1 -1
- package/es/common/components/date-picker/data.d.ts.map +1 -1
- package/es/common/components/date-picker/data.js +3 -3
- package/es/common/components/date-picker/date-item.d.ts.map +1 -1
- package/es/common/components/date-picker/date-item.js +2 -2
- package/es/common/components/date-picker/utils.d.ts.map +1 -1
- package/es/common/components/date-picker/utils.js +6 -0
- package/es/future/components/msem-preset-editor/editors/vakario.js +4 -4
- package/package.json +1 -1
|
@@ -83,5 +83,5 @@ export namespace WEEK_DAYS {
|
|
|
83
83
|
export { en_1 as en };
|
|
84
84
|
}
|
|
85
85
|
export const CALENDAR_WEEKS: 6;
|
|
86
|
-
export function calendar(month?: number, year?: number):
|
|
86
|
+
export function calendar(month?: number, year?: number): string[];
|
|
87
87
|
//# sourceMappingURL=data.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/data.js"],"names":[],"mappings":";;;;;;;;;;;AAaA,+BAAkD;AAElD,gCAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDpD,+BAAgC;AAEzB,
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/data.js"],"names":[],"mappings":";;;;;;;;;;;AAaA,+BAAkD;AAElD,gCAAoD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDpD,+BAAgC;AAEzB,kEAyCN"}
|
|
@@ -71,15 +71,15 @@ export const calendar = (month = THIS_MONTH, year = THIS_YEAR) => {
|
|
|
71
71
|
const prevMonthDays = Utils.getMonthDays(prevMonth, prevMonthYear);
|
|
72
72
|
const prevMonthDates = [...new Array(daysFromPrevMonth)].map((_, i) => {
|
|
73
73
|
const day = i + 1 + (prevMonthDays - daysFromPrevMonth);
|
|
74
|
-
return
|
|
74
|
+
return `${prevMonthYear}-${Utils.zeroPad(prevMonth, 2)}-${Utils.zeroPad(day, 2)}`;
|
|
75
75
|
});
|
|
76
76
|
const thisMonthDates = [...new Array(monthDays)].map((_, i) => {
|
|
77
77
|
const day = i + 1;
|
|
78
|
-
return
|
|
78
|
+
return `${year}-${Utils.zeroPad(month, 2)}-${Utils.zeroPad(day, 2)}`;
|
|
79
79
|
});
|
|
80
80
|
const nextMonthDates = [...new Array(daysFromNextMonth)].map((_, i) => {
|
|
81
81
|
const day = i + 1;
|
|
82
|
-
return
|
|
82
|
+
return `${nextMonthYear}-${Utils.zeroPad(nextMonth, 2)}-${Utils.zeroPad(day, 2)}`;
|
|
83
83
|
});
|
|
84
84
|
return [...prevMonthDates, ...thisMonthDates, ...nextMonthDates];
|
|
85
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-item.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/date-item.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"date-item.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/date-item.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;4CAuLC"}
|
|
@@ -10,12 +10,12 @@ import styles from "./date-item.module.css";
|
|
|
10
10
|
export default function DateItem({ date, index, month, year, min, max, selectedDates, setSelectedDates, setFirstSelectedDate, setLastSelectedDate, selecting, setSelecting, singleDate, submitOnSelectionEnd, onSubmit, stays, matchingStays, allMatchingStaysEnd, }) {
|
|
11
11
|
const { lang } = useUbloContext();
|
|
12
12
|
const today = new Date();
|
|
13
|
-
const _date = React.useMemo(() => new Date(date
|
|
13
|
+
const _date = React.useMemo(() => new Date(date), [date]);
|
|
14
14
|
_date.setHours(0, 0, 0, 0);
|
|
15
15
|
const isToday = Utils.isSameDay(_date, today);
|
|
16
16
|
const isInMonth = month &&
|
|
17
17
|
year &&
|
|
18
|
-
Utils.isSameMonth(_date, new Date(
|
|
18
|
+
Utils.isSameMonth(_date, new Date(`${Utils.zeroPad(year, 2)}-${Utils.zeroPad(month, 2)}-02`));
|
|
19
19
|
const firstSelectedDate = selectedDates[0];
|
|
20
20
|
const isFirstSelected = selectedDates.map(Number).indexOf(Number(_date)) === 0;
|
|
21
21
|
const isLastSelected = selectedDates.map(Number).indexOf(Number(_date)) ===
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/utils.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/common/components/date-picker/utils.js"],"names":[],"mappings":"AAoHA,qDAIC;AAmDD,sEAQC;AAjLM,yDAAmE;AAEnE,+EAcN;AAEM,wEAON;AAEM,kDAON;AAEM,8CAON;AAEM,2CAKN;AAEM,iEAaN;AAEM,+DAmBN;AAEM,2CAMN;AAEM,uDAON;AAEM,sDAON;AAQM,qEAQN;AAEM,gDAQN;AAEM,yEAaN;AAEM;;;EAKN;AAEM;;;EAKN"}
|
|
@@ -18,6 +18,7 @@ export const getMonthFirstDay = (month = Data.THIS_MONTH, year = Data.THIS_YEAR)
|
|
|
18
18
|
};
|
|
19
19
|
export const weekToLongDate = (date) => {
|
|
20
20
|
const _date = new Date(date);
|
|
21
|
+
_date.setHours(0, 0, 0, 0);
|
|
21
22
|
const dd = zeroPad(_date.getDate(), 2);
|
|
22
23
|
const mm = zeroPad(_date.getMonth() + 1, 2);
|
|
23
24
|
const yy = _date.getFullYear();
|
|
@@ -25,6 +26,7 @@ export const weekToLongDate = (date) => {
|
|
|
25
26
|
};
|
|
26
27
|
export const formatDate = (date) => {
|
|
27
28
|
const d = new Date(date);
|
|
29
|
+
d.setHours(0, 0, 0, 0);
|
|
28
30
|
const day = zeroPad(d.getDate(), 2);
|
|
29
31
|
const month = zeroPad(d.getMonth() + 1, 2);
|
|
30
32
|
const year = d.getFullYear();
|
|
@@ -38,6 +40,8 @@ export const isDate = (date) => {
|
|
|
38
40
|
export const isSameMonth = (date, basedate = new Date()) => {
|
|
39
41
|
if (!(isDate(date) && isDate(basedate)))
|
|
40
42
|
return false;
|
|
43
|
+
date.setHours(0, 0, 0, 0);
|
|
44
|
+
basedate.setHours(0, 0, 0, 0);
|
|
41
45
|
const basedateMonth = basedate.getMonth() + 1;
|
|
42
46
|
const basedateYear = basedate.getFullYear();
|
|
43
47
|
const dateMonth = date.getMonth() + 1;
|
|
@@ -47,6 +51,8 @@ export const isSameMonth = (date, basedate = new Date()) => {
|
|
|
47
51
|
export const isSameDay = (date, basedate = new Date()) => {
|
|
48
52
|
if (!(isDate(date) && isDate(basedate)))
|
|
49
53
|
return false;
|
|
54
|
+
date.setHours(0, 0, 0, 0);
|
|
55
|
+
basedate.setHours(0, 0, 0, 0);
|
|
50
56
|
const basedateDate = basedate.getDate();
|
|
51
57
|
const basedateMonth = basedate.getMonth() + 1;
|
|
52
58
|
const basedateYear = basedate.getFullYear();
|
|
@@ -171,9 +171,9 @@ function getDefaultData(preset) {
|
|
|
171
171
|
return DEFAULT_DATA;
|
|
172
172
|
const { kindCodes, ageCodes, categoryCodes, levelCodes } = preset?.presets || {};
|
|
173
173
|
return {
|
|
174
|
-
kindCodes: kindCodes || DEFAULT_DATA.kindCodes,
|
|
175
|
-
ageCodes: ageCodes || DEFAULT_DATA.ageCodes,
|
|
176
|
-
categoryCodes: categoryCodes || DEFAULT_DATA.categoryCodes,
|
|
177
|
-
levelCodes: levelCodes || DEFAULT_DATA.levelCodes,
|
|
174
|
+
kindCodes: kindCodes?.[0] || DEFAULT_DATA.kindCodes,
|
|
175
|
+
ageCodes: ageCodes?.[0] || DEFAULT_DATA.ageCodes,
|
|
176
|
+
categoryCodes: categoryCodes?.[0] || DEFAULT_DATA.categoryCodes,
|
|
177
|
+
levelCodes: levelCodes?.[0] || DEFAULT_DATA.levelCodes,
|
|
178
178
|
};
|
|
179
179
|
}
|