sanity-plugin-recurring-dates 1.4.1 → 2.0.1
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.
- package/README.md +6 -2
- package/dist/index.d.mts +49 -0
- package/dist/index.js +1714 -4161
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2520 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +44 -38
- package/src/components/CustomRule/Monthly.tsx +1 -1
- package/src/utils.ts +1 -0
- package/dist/index.esm.js +0 -4950
- package/dist/index.esm.js.map +0 -1
package/README.md
CHANGED
|
@@ -64,9 +64,11 @@ export default defineConfig({
|
|
|
64
64
|
// Configure the datepickers
|
|
65
65
|
// See https://www.sanity.io/docs/datetime-type#options
|
|
66
66
|
dateTimeOptions: {
|
|
67
|
-
dateFormat: 'DD/MM/
|
|
67
|
+
dateFormat: 'DD/MM/YYYY',
|
|
68
68
|
timeFormat: 'HH:mm',
|
|
69
69
|
timeStep: 15,
|
|
70
|
+
displayTimeZone: 'Europe/London',
|
|
71
|
+
allowTimeZoneSwitch: false,
|
|
70
72
|
},
|
|
71
73
|
|
|
72
74
|
// Changes the date picker to date only, no time
|
|
@@ -112,9 +114,11 @@ defineField({
|
|
|
112
114
|
// Configure the datepickers
|
|
113
115
|
// See https://www.sanity.io/docs/datetime-type#options
|
|
114
116
|
dateTimeOptions: {
|
|
115
|
-
dateFormat: 'DD/MM/
|
|
117
|
+
dateFormat: 'DD/MM/YYYY',
|
|
116
118
|
timeFormat: 'HH:mm',
|
|
117
119
|
timeStep: 15,
|
|
120
|
+
displayTimeZone: 'Europe/London',
|
|
121
|
+
allowTimeZoneSwitch: false,
|
|
118
122
|
},
|
|
119
123
|
|
|
120
124
|
// Changes the date picker to date only, no time
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type {DateRule} from 'sanity'
|
|
2
|
+
import type {DatetimeOptions} from 'sanity'
|
|
3
|
+
import type {ObjectDefinition} from 'sanity'
|
|
4
|
+
import {Plugin as Plugin_2} from 'sanity'
|
|
5
|
+
|
|
6
|
+
export declare interface PluginConfig {
|
|
7
|
+
defaultRecurrences?: string[]
|
|
8
|
+
hideEndDate?: boolean
|
|
9
|
+
hideCustom?: boolean
|
|
10
|
+
dateTimeOptions?: DatetimeOptions
|
|
11
|
+
dateOnly?: boolean
|
|
12
|
+
validation?: {
|
|
13
|
+
startDate?: (Rule: DateRule) => DateRule
|
|
14
|
+
endDate?: (Rule: DateRule) => DateRule
|
|
15
|
+
}
|
|
16
|
+
fieldTitles?: {
|
|
17
|
+
startDate?: string
|
|
18
|
+
endDate?: string
|
|
19
|
+
}
|
|
20
|
+
fieldDescriptions?: {
|
|
21
|
+
startDate?: string
|
|
22
|
+
endDate?: string
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare interface RecurringDate {
|
|
27
|
+
rrule?: string
|
|
28
|
+
startDate?: string
|
|
29
|
+
endDate?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export declare type RecurringDateFieldOptions = Omit<ObjectDefinition, 'type' | 'fields'> & {
|
|
33
|
+
type: 'recurringDates'
|
|
34
|
+
options?: PluginConfig
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export declare const recurringDates: Plugin_2<void | PluginConfig>
|
|
38
|
+
|
|
39
|
+
export declare type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
|
|
40
|
+
[Property in Key]-?: Type[Property]
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export {}
|
|
44
|
+
|
|
45
|
+
declare module 'sanity' {
|
|
46
|
+
interface IntrinsicDefinitions {
|
|
47
|
+
recurringDates: RecurringDateFieldOptions
|
|
48
|
+
}
|
|
49
|
+
}
|