Skip to content

Commit 2f7f94e

Browse files
Update Ember Power Calendar (#786)
* Update Ember Power Calendar * apply per migration guidelines * fix linting errors --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jeldrik Hanschke <admin@jhanschke.de>
1 parent 79fee84 commit 2f7f94e

File tree

6 files changed

+503
-36
lines changed

6 files changed

+503
-36
lines changed

app/app.ts

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import Application from '@ember/application';
22
import Resolver from 'ember-resolver';
33
import loadInitializers from 'ember-load-initializers';
44
import config from 'croodle/config/environment';
5+
import { registerDateLibrary } from 'ember-power-calendar';
6+
import DateUtils from 'ember-power-calendar-luxon';
57

68
export default class App extends Application {
79
modulePrefix = config.modulePrefix;
@@ -10,3 +12,4 @@ export default class App extends Application {
1012
}
1113

1214
loadInitializers(App, config.modulePrefix);
15+
registerDateLibrary(DateUtils);

package-lock.json

+26-34
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@
100100
"ember-math-helpers": "4.0.0",
101101
"ember-modifier": "4.1.0",
102102
"ember-page-title": "8.2.3",
103-
"ember-power-calendar": "0.20.2",
104-
"ember-power-calendar-luxon": "0.5.0",
103+
"ember-power-calendar": "0.21.0",
104+
"ember-power-calendar-luxon": "0.6.0",
105105
"ember-qunit": "7.0.0",
106106
"ember-resolver": "11.0.1",
107107
"ember-sinon-qunit": "7.4.0",
+132
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
declare module 'ember-power-calendar-luxon' {
2+
import type {
3+
NormalizeCalendarValue,
4+
NormalizeMultipleActionValue,
5+
NormalizeRangeActionValue,
6+
PowerCalendarDay,
7+
} from 'ember-power-calendar/utils';
8+
9+
const _default: {
10+
add: typeof add;
11+
12+
formatDate: typeof formatDate;
13+
14+
startOf: typeof startOf;
15+
16+
endOf: typeof endOf;
17+
18+
weekday: typeof weekday;
19+
20+
isoWeekday: typeof isoWeekday;
21+
22+
getWeekdaysShort: typeof getWeekdaysShort;
23+
24+
getWeekdaysMin: typeof getWeekdaysMin;
25+
26+
getWeekdays: typeof getWeekdays;
27+
28+
isAfter: typeof isAfter;
29+
30+
isBefore: typeof isBefore;
31+
32+
isSame: typeof isSame;
33+
34+
isBetween: typeof isBetween;
35+
36+
diff: typeof diff;
37+
38+
normalizeDate: typeof normalizeDate;
39+
40+
normalizeRangeActionValue: typeof normalizeRangeActionValue;
41+
42+
normalizeMultipleActionValue: typeof normalizeMultipleActionValue;
43+
44+
normalizeCalendarDay: typeof normalizeCalendarDay;
45+
46+
withLocale: typeof withLocale;
47+
48+
normalizeCalendarValue: typeof normalizeCalendarValue;
49+
50+
normalizeDuration: typeof normalizeDuration;
51+
52+
getDefaultLocale: typeof getDefaultLocale;
53+
54+
localeStartOfWeek: typeof localeStartOfWeek;
55+
56+
startOfWeek: typeof startOfWeek;
57+
58+
endOfWeek: typeof endOfWeek;
59+
};
60+
61+
export default _default;
62+
63+
export function add(date: Date, quantity: number, unit: string): Date;
64+
65+
export function formatDate(
66+
date: Date,
67+
format: string,
68+
locale?: string | null,
69+
): string;
70+
71+
export function startOf(date: Date, unit: string): Date;
72+
73+
export function endOf(date: Date, unit: string): Date;
74+
75+
export function weekday(date: Date): number;
76+
77+
export function isoWeekday(date: Date): number;
78+
79+
export function getWeekdaysShort(): string[];
80+
81+
export function getWeekdaysMin(): string[];
82+
83+
export function getWeekdays(): string[];
84+
85+
export function isAfter(date1: Date, date2: Date): boolean;
86+
87+
export function isBefore(date1: Date, date2: Date): boolean;
88+
89+
export function isSame(date1: Date, date2: Date, unit: string): boolean;
90+
91+
export function isBetween(
92+
date: Date,
93+
start: Date,
94+
end: Date,
95+
_unit?: string,
96+
_inclusivity?: string,
97+
): boolean;
98+
99+
export function diff(date1: Date, date2: Date): number;
100+
101+
export function normalizeDate(dateOrDateTime?: unknown): Date | undefined;
102+
103+
export function normalizeRangeActionValue(val: {
104+
date: {
105+
start?: Date | null;
106+
107+
end?: Date | null;
108+
};
109+
}): NormalizeRangeActionValue;
110+
111+
export function normalizeMultipleActionValue(val: {
112+
date: Date[];
113+
}): NormalizeMultipleActionValue;
114+
115+
export function normalizeCalendarDay(day: PowerCalendarDay): PowerCalendarDay;
116+
117+
export function withLocale(locale: string, fn: () => unknown): unknown;
118+
119+
export function normalizeCalendarValue(value: {
120+
date: Date;
121+
}): NormalizeCalendarValue;
122+
123+
export function normalizeDuration(value: unknown): number | null | undefined;
124+
125+
export function getDefaultLocale(): string;
126+
127+
export function localeStartOfWeek(locale: string): number;
128+
129+
export function startOfWeek(day: Date, startOfWeek: number): Date;
130+
131+
export function endOfWeek(day: Date, startOfWeek: number): Date;
132+
}

0 commit comments

Comments
 (0)