accomadesc 0.2.0 → 0.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.
@@ -19,12 +19,15 @@
19
19
  maxFutureYears = 2,
20
20
  translateFunc,
21
21
  }: CalendarContent & I18nFacade & { debug?: boolean } = $props();
22
+
23
+ let minDate = $derived(DateTime.utc().minus({ year: maxPastYears }));
24
+ let maxDate = $derived(DateTime.utc().plus({ year: maxFutureYears }));
22
25
  </script>
23
26
 
24
27
  <div class="cal-wrapper">
25
28
  <OccuPlanWrapper
26
- minDate={DateTime.utc().set({ day: 1, month: 1 }).minus({ year: maxPastYears })}
27
- maxDate={DateTime.utc().set({ day: 31, month: 12 }).plus({ year: maxFutureYears })}
29
+ {minDate}
30
+ {maxDate}
28
31
  {url}
29
32
  {debug}
30
33
  {toggleGridOffset}
@@ -16,7 +16,9 @@
16
16
 
17
17
  let availHeader = $derived(translateFunc ? translateFunc('availability') : '[AVAILABILITY]');
18
18
 
19
- const maxFutureDate = DateTime.utc().set({ day: 31, month: 12 }).plus({ years: maxFutureYears });
19
+ let maxFutureDate = $derived(
20
+ DateTime.utc().set({ day: 31, month: 12 }).plus({ years: maxFutureYears }),
21
+ );
20
22
 
21
23
  const formatAvailability = (from: DateTime | null, forDays: number): string => {
22
24
  if (!formatFunc || !formatDateFunc) return '';
@@ -9,16 +9,25 @@
9
9
  calendarTranslation,
10
10
  maxPastYears = 0,
11
11
  maxFutureYears = 2,
12
+ maxWidth = '1200px',
13
+ firstMonth = 0,
14
+ monthNumbers = 12,
12
15
  translateFunc,
13
16
  }: CalendarGridContent & I18nFacade & { debug?: boolean } = $props();
17
+
18
+ let minDate = $derived(DateTime.utc().minus({ year: maxPastYears }));
19
+ let maxDate = $derived(DateTime.utc().plus({ year: maxFutureYears }));
14
20
  </script>
15
21
 
16
22
  <div class="cal-wrapper">
17
23
  <OccuPlanGrid
18
24
  {url}
19
25
  {debug}
20
- minDate={DateTime.utc().set({ day: 1, month: 1 }).minus({ year: maxPastYears })}
21
- maxDate={DateTime.utc().set({ day: 31, month: 12 }).plus({ year: maxFutureYears })}
26
+ {minDate}
27
+ {maxDate}
28
+ numberOfMonth={monthNumbers}
29
+ {maxWidth}
30
+ {firstMonth}
22
31
  header={translateFunc ? translateFunc('calendarHeader') : ''}
23
32
  {...calendarTranslation}
24
33
  />
@@ -9,16 +9,24 @@
9
9
  calendarTranslation,
10
10
  maxPastYears = 0,
11
11
  maxFutureYears = 2,
12
+ maxWidth = '1200px',
13
+ firstMonth = 0,
14
+ monthNumbers = 12,
12
15
  translateFunc,
13
16
  }: CalendarRowsContent & I18nFacade & { debug?: boolean } = $props();
17
+ let minDate = $derived(DateTime.utc().minus({ year: maxPastYears }));
18
+ let maxDate = $derived(DateTime.utc().plus({ year: maxFutureYears }));
14
19
  </script>
15
20
 
16
21
  <div class="cal-wrapper">
17
22
  <OccuPlanRows
18
23
  {url}
24
+ {maxWidth}
25
+ {firstMonth}
26
+ numberOfMonth={monthNumbers}
19
27
  {debug}
20
- minDate={DateTime.utc().set({ day: 1, month: 1 }).minus({ years: maxPastYears })}
21
- maxDate={DateTime.utc().set({ day: 31, month: 12 }).plus({ years: maxFutureYears })}
28
+ {maxDate}
29
+ {minDate}
22
30
  header={translateFunc ? translateFunc('calendarHeader') : ''}
23
31
  {...calendarTranslation}
24
32
  />
package/dist/types.d.ts CHANGED
@@ -61,6 +61,9 @@ export interface CalendarGridContent {
61
61
  url: string;
62
62
  maxFutureYears?: number;
63
63
  maxPastYears?: number;
64
+ monthNumbers?: number;
65
+ firstMonth?: FirstMonth;
66
+ maxWidth?: string;
64
67
  }
65
68
  export interface CalendarRows {
66
69
  id: string;
@@ -71,6 +74,9 @@ export interface CalendarRowsContent {
71
74
  url: string;
72
75
  maxFutureYears?: number;
73
76
  maxPastYears?: number;
77
+ monthNumbers?: number;
78
+ firstMonth?: FirstMonth;
79
+ maxWidth?: string;
74
80
  }
75
81
  export interface Text {
76
82
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accomadesc",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",