sanity-plugin-recurring-dates 1.1.1 → 1.3.0

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 CHANGED
@@ -108,6 +108,12 @@ defineField({
108
108
 
109
109
  // Changes the date picker to date only, no time
110
110
  dateOnly: true, // defaults to false
111
+
112
+ // override the default validation
113
+ validation: {
114
+ startDate: (Rule) => Rule.required() // defaults to (Rule) => Rule.required()
115
+ endDate: (Rule) => Rule.min(Rule.valueOfField('startDate')) // defaults to (Rule) => Rule.min(Rule.valueOfField('startDate'))
116
+ }
111
117
  },
112
118
  })
113
119
  ```
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type {DateRule} from 'sanity'
1
2
  import type {DatetimeOptions} from 'sanity'
2
3
  import type {ObjectDefinition} from 'sanity'
3
4
  import {Plugin as Plugin_2} from 'sanity'
@@ -8,12 +9,16 @@ export declare interface PluginConfig {
8
9
  hideCustom?: boolean
9
10
  dateTimeOptions?: DatetimeOptions
10
11
  dateOnly?: boolean
12
+ validation?: {
13
+ startDate?: (Rule: DateRule) => DateRule
14
+ endDate?: (Rule: DateRule) => DateRule
15
+ }
11
16
  }
12
17
 
13
18
  export declare interface RecurringDate {
14
- rrule: string
15
- startDate: string
16
- endDate: string
19
+ rrule?: string
20
+ startDate?: string
21
+ endDate?: string
17
22
  }
18
23
 
19
24
  export declare type RecurringDateFieldOptions = Omit<ObjectDefinition, 'type' | 'fields'> & {