Skip to content

Commit 4bf8faa

Browse files
committed
fix: interface Period
1 parent 9321c70 commit 4bf8faa

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

core/src/components/cron-core.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class DefaultCronOptions {
9999
]
100100
}
101101

102-
periods(format: CronFormat) {
102+
periods(format: CronFormat): Period[] {
103103
const isQuartz = format == 'quartz'
104104
const second = isQuartz ? [{ id: 'q-second', value: [] }] : []
105105
const secondField = isQuartz ? ['second'] : []
@@ -146,7 +146,7 @@ export function useCron(options: CronOptions) {
146146
const periods = (options.periods ?? cronDefaults.periods(format)).map((p) => {
147147
return {
148148
...p,
149-
text: l10n.getLocaleStr(p.id, TextPosition.Text),
149+
text: p.text ?? l10n.getLocaleStr(p.id, TextPosition.Text),
150150
}
151151
})
152152
const initialPeriod =

core/src/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export interface Period {
5252
* The value determines which fields are visible
5353
*/
5454
value: string[]
55+
56+
/**
57+
* The display name of the period
58+
*/
59+
text?: string
5560
}
5661

5762
export class FieldWrapper {

0 commit comments

Comments
 (0)