Skip to content

Commit a37e4b5

Browse files
dimfeldtechniq
authored andcommitted
fix getPeriodTypeName calls (#207)
1 parent 740d5fa commit a37e4b5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/svelte-ux/src/lib/components/DateRangeField.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,14 @@
88
import Dialog from './Dialog.svelte';
99
import Field from './Field.svelte';
1010
11-
import { PeriodType, getDateFuncsByPeriodType, getPeriodTypeName } from '../utils/date';
11+
import { PeriodType, getDateFuncsByPeriodType } from '../utils/date';
1212
import { getDateRangePresets, type DateRange as DateRangeType } from '../utils/dateRange';
1313
import { cls } from '../utils/styles';
1414
import { getSettings } from './settings';
1515
1616
const dispatch = createEventDispatcher();
1717
const settings = getSettings();
18+
const { format } = settings;
1819
1920
const _defaultValue: DateRangeType = {
2021
from: null,
@@ -60,7 +61,7 @@
6061
</script>
6162

6263
<Field
63-
label={label ?? (value.periodType ? getPeriodTypeName(settings, value.periodType) : '')}
64+
label={label ?? (value.periodType ? $format.getPeriodTypeName(value.periodType) : '')}
6465
{icon}
6566
{error}
6667
{hint}
@@ -153,7 +154,7 @@
153154
>
154155
<div class="flex flex-col justify-center bg-primary text-primary-content px-6 h-24">
155156
<div class="text-sm opacity-50">
156-
{currentValue.periodType ? getPeriodTypeName(settings, currentValue.periodType) : ''}&nbsp;
157+
{currentValue.periodType ? $format.getPeriodTypeName(currentValue.periodType) : ''}&nbsp;
157158
</div>
158159
<div class="text-xl sm:text-2xl">
159160
<DateRangeDisplay value={currentValue} />

0 commit comments

Comments
 (0)