@commercetools-uikit/calendar-time-utils 20.2.0 → 20.2.2
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.
|
@@ -147,8 +147,8 @@ const getWeekdayNames = locale => {
|
|
|
147
147
|
return [..._sliceInstanceProperty__default["default"](weekDays).call(weekDays, firstDay), ..._sliceInstanceProperty__default["default"](weekDays).call(weekDays, 0, firstDay)];
|
|
148
148
|
};
|
|
149
149
|
const getStartOf = (day, timeZone) => moment__default["default"].tz(day, timeZone).startOf('day').toISOString();
|
|
150
|
-
const getMonthCalendarLabel = (day, locale) => moment__default["default"](day, moment__default["default"].ISO_8601, locale).format('MMMM');
|
|
151
|
-
const getYearCalendarLabel = (day, locale) => moment__default["default"](day, moment__default["default"].ISO_8601, locale).format('YYYY');
|
|
150
|
+
const getMonthCalendarLabel = (day, locale, timeZone) => timeZone ? moment__default["default"].tz(day, timeZone).locale(locale).format('MMMM') : moment__default["default"](day, moment__default["default"].ISO_8601, locale).format('MMMM');
|
|
151
|
+
const getYearCalendarLabel = (day, locale, timeZone) => timeZone ? moment__default["default"].tz(day, timeZone).locale(locale).format('YYYY') : moment__default["default"](day, moment__default["default"].ISO_8601, locale).format('YYYY');
|
|
152
152
|
const isSameDay = (a, b) => moment__default["default"](a).isSame(b, 'day');
|
|
153
153
|
const getCalendarDayLabel = (day, timeZone) => moment__default["default"].tz(day, timeZone).format('D');
|
|
154
154
|
const createItemDateTimeToString = (locale, timeZone) => item => item ? formatDate(item, locale, timeZone) : '';
|
|
@@ -241,7 +241,7 @@ const getLocalizedDateTimeFormatPattern = function (locale) {
|
|
|
241
241
|
};
|
|
242
242
|
|
|
243
243
|
// NOTE: This string will be replaced on build time with the package version.
|
|
244
|
-
var version = "20.2.
|
|
244
|
+
var version = "20.2.2";
|
|
245
245
|
|
|
246
246
|
exports.changeDateInMonth = changeDateInMonth;
|
|
247
247
|
exports.changeMonth = changeMonth;
|
|
@@ -146,8 +146,8 @@ const getWeekdayNames = locale => {
|
|
|
146
146
|
return [..._sliceInstanceProperty__default["default"](weekDays).call(weekDays, firstDay), ..._sliceInstanceProperty__default["default"](weekDays).call(weekDays, 0, firstDay)];
|
|
147
147
|
};
|
|
148
148
|
const getStartOf = (day, timeZone) => moment__default["default"].tz(day, timeZone).startOf('day').toISOString();
|
|
149
|
-
const getMonthCalendarLabel = (day, locale) => moment__default["default"](day, moment__default["default"].ISO_8601, locale).format('MMMM');
|
|
150
|
-
const getYearCalendarLabel = (day, locale) => moment__default["default"](day, moment__default["default"].ISO_8601, locale).format('YYYY');
|
|
149
|
+
const getMonthCalendarLabel = (day, locale, timeZone) => timeZone ? moment__default["default"].tz(day, timeZone).locale(locale).format('MMMM') : moment__default["default"](day, moment__default["default"].ISO_8601, locale).format('MMMM');
|
|
150
|
+
const getYearCalendarLabel = (day, locale, timeZone) => timeZone ? moment__default["default"].tz(day, timeZone).locale(locale).format('YYYY') : moment__default["default"](day, moment__default["default"].ISO_8601, locale).format('YYYY');
|
|
151
151
|
const isSameDay = (a, b) => moment__default["default"](a).isSame(b, 'day');
|
|
152
152
|
const getCalendarDayLabel = (day, timeZone) => moment__default["default"].tz(day, timeZone).format('D');
|
|
153
153
|
const createItemDateTimeToString = (locale, timeZone) => item => item ? formatDate(item, locale, timeZone) : '';
|
|
@@ -240,7 +240,7 @@ const getLocalizedDateTimeFormatPattern = function (locale) {
|
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
// NOTE: This string will be replaced on build time with the package version.
|
|
243
|
-
var version = "20.2.
|
|
243
|
+
var version = "20.2.2";
|
|
244
244
|
|
|
245
245
|
exports.changeDateInMonth = changeDateInMonth;
|
|
246
246
|
exports.changeMonth = changeMonth;
|
|
@@ -131,8 +131,8 @@ const getWeekdayNames = locale => {
|
|
|
131
131
|
return [..._sliceInstanceProperty(weekDays).call(weekDays, firstDay), ..._sliceInstanceProperty(weekDays).call(weekDays, 0, firstDay)];
|
|
132
132
|
};
|
|
133
133
|
const getStartOf = (day, timeZone) => moment.tz(day, timeZone).startOf('day').toISOString();
|
|
134
|
-
const getMonthCalendarLabel = (day, locale) => moment(day, moment.ISO_8601, locale).format('MMMM');
|
|
135
|
-
const getYearCalendarLabel = (day, locale) => moment(day, moment.ISO_8601, locale).format('YYYY');
|
|
134
|
+
const getMonthCalendarLabel = (day, locale, timeZone) => timeZone ? moment.tz(day, timeZone).locale(locale).format('MMMM') : moment(day, moment.ISO_8601, locale).format('MMMM');
|
|
135
|
+
const getYearCalendarLabel = (day, locale, timeZone) => timeZone ? moment.tz(day, timeZone).locale(locale).format('YYYY') : moment(day, moment.ISO_8601, locale).format('YYYY');
|
|
136
136
|
const isSameDay = (a, b) => moment(a).isSame(b, 'day');
|
|
137
137
|
const getCalendarDayLabel = (day, timeZone) => moment.tz(day, timeZone).format('D');
|
|
138
138
|
const createItemDateTimeToString = (locale, timeZone) => item => item ? formatDate(item, locale, timeZone) : '';
|
|
@@ -225,6 +225,6 @@ const getLocalizedDateTimeFormatPattern = function (locale) {
|
|
|
225
225
|
};
|
|
226
226
|
|
|
227
227
|
// NOTE: This string will be replaced on build time with the package version.
|
|
228
|
-
var version = "20.2.
|
|
228
|
+
var version = "20.2.2";
|
|
229
229
|
|
|
230
230
|
export { changeDateInMonth, changeMonth, changeTime, createCalendarItems, createItemDateTimeToString, createSuggestedItems, formatDate, formatDefaultTime, formatTime, getCalendarDayLabel, getDateInMonth, getDaysInMonth, getLocalizedDateTimeFormatPattern, getMonthCalendarLabel, getPaddingDayCount, getPreviousDay, getStartOf, getToday, getWeekdayNames, getYearCalendarLabel, isSameDay, parseInputText, version };
|
|
@@ -18,8 +18,8 @@ export declare const changeMonth: (day: MomentInput, timeZone: string, delta: Du
|
|
|
18
18
|
export declare const getPaddingDayCount: (day: MomentInput, locale: string, timeZone: string) => number;
|
|
19
19
|
export declare const getWeekdayNames: (locale: string) => string[];
|
|
20
20
|
export declare const getStartOf: (day: MomentInput, timeZone: string) => string;
|
|
21
|
-
export declare const getMonthCalendarLabel: (day: MomentInput, locale: string) => string;
|
|
22
|
-
export declare const getYearCalendarLabel: (day: MomentInput, locale: string) => string;
|
|
21
|
+
export declare const getMonthCalendarLabel: (day: MomentInput, locale: string, timeZone?: string) => string;
|
|
22
|
+
export declare const getYearCalendarLabel: (day: MomentInput, locale: string, timeZone?: string) => string;
|
|
23
23
|
export declare const isSameDay: (a: MomentInput, b: MomentInput) => boolean;
|
|
24
24
|
export declare const getCalendarDayLabel: (day: MomentInput, timeZone: string) => string;
|
|
25
25
|
export declare const createItemDateTimeToString: (locale: string, timeZone: string) => (item: string | null) => string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-uikit/calendar-time-utils",
|
|
3
3
|
"description": "Utilities to work with time values for a calendar.",
|
|
4
|
-
"version": "20.2.
|
|
4
|
+
"version": "20.2.2",
|
|
5
5
|
"bugs": "https://github.com/commercetools/ui-kit/issues",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@babel/runtime": "^7.20.13",
|
|
23
23
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
24
|
-
"@commercetools-uikit/utils": "20.2.
|
|
24
|
+
"@commercetools-uikit/utils": "20.2.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"moment-timezone": "0.6.0"
|