accomadesc 0.1.42 → 0.1.44

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.
@@ -1,6 +1,7 @@
1
1
  <script lang="ts">
2
2
  import OccuPlanWrapper from './occuplan/OccuPlanWrapper.svelte';
3
3
  import type { CalendarContent, I18nFacade } from './types.js';
4
+ import { DateTime } from 'luxon';
4
5
 
5
6
  let {
6
7
  url,
@@ -14,12 +15,16 @@
14
15
  rowsMonthNumbers,
15
16
  rowsFirstMonth,
16
17
  rowsMaxWidth,
18
+ minYear = DateTime.utc().year,
19
+ maxYear = DateTime.utc().plus({ year: 2 }).year,
17
20
  translateFunc,
18
21
  }: CalendarContent & I18nFacade & { debug?: boolean } = $props();
19
22
  </script>
20
23
 
21
24
  <div class="cal-wrapper">
22
25
  <OccuPlanWrapper
26
+ minDate={DateTime.utc().set({ day: 1, month: 1, year: minYear })}
27
+ maxDate={DateTime.utc().set({ day: 31, month: 12, year: maxYear })}
23
28
  {url}
24
29
  {debug}
25
30
  {toggleGridOffset}
@@ -1,11 +1,14 @@
1
1
  <script lang="ts">
2
2
  import type { CalendarGridContent, I18nFacade } from './types.js';
3
3
  import OccuPlanGrid from './occuplan/OccuPlanGrid.svelte';
4
+ import { DateTime } from 'luxon';
4
5
 
5
6
  let {
6
7
  url,
7
8
  debug = false,
8
9
  calendarTranslation,
10
+ minYear = DateTime.utc().year,
11
+ maxYear = DateTime.utc().plus({ year: 2 }).year,
9
12
  translateFunc,
10
13
  }: CalendarGridContent & I18nFacade & { debug?: boolean } = $props();
11
14
  </script>
@@ -14,6 +17,8 @@
14
17
  <OccuPlanGrid
15
18
  {url}
16
19
  {debug}
20
+ minDate={DateTime.utc().set({ day: 1, month: 1, year: minYear })}
21
+ maxDate={DateTime.utc().set({ day: 31, month: 12, year: maxYear })}
17
22
  header={translateFunc ? translateFunc('calendarHeader') : ''}
18
23
  {...calendarTranslation}
19
24
  />
@@ -1,11 +1,14 @@
1
1
  <script lang="ts">
2
2
  import type { CalendarRowsContent, I18nFacade } from './types.js';
3
3
  import OccuPlanRows from './occuplan/OccuPlanRows.svelte';
4
+ import { DateTime } from 'luxon';
4
5
 
5
6
  let {
6
7
  url,
7
8
  debug,
8
9
  calendarTranslation,
10
+ minYear = DateTime.utc().year,
11
+ maxYear = DateTime.utc().plus({ year: 2 }).year,
9
12
  translateFunc,
10
13
  }: CalendarRowsContent & I18nFacade & { debug?: boolean } = $props();
11
14
  </script>
@@ -14,6 +17,8 @@
14
17
  <OccuPlanRows
15
18
  {url}
16
19
  {debug}
20
+ minDate={DateTime.utc().set({ day: 1, month: 1, year: minYear })}
21
+ maxDate={DateTime.utc().set({ day: 31, month: 12, year: maxYear })}
17
22
  header={translateFunc ? translateFunc('calendarHeader') : ''}
18
23
  {...calendarTranslation}
19
24
  />
package/dist/types.d.ts CHANGED
@@ -39,6 +39,8 @@ export interface CalendarContent {
39
39
  rowsMonthNumbers?: number;
40
40
  rowsFirstMonth?: FirstMonth;
41
41
  rowsMaxWidth?: string;
42
+ maxYear?: number;
43
+ minYear?: number;
42
44
  }
43
45
  export interface CalendarAvailable {
44
46
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accomadesc",
3
- "version": "0.1.42",
3
+ "version": "0.1.44",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",