sanity-plugin-recurring-dates 1.0.2 → 1.1.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/LICENSE +1 -1
- package/README.md +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +586 -528
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +586 -528
- package/dist/index.js.map +1 -1
- package/package.json +23 -23
- package/src/components/CustomRule/Monthly.tsx +1 -1
- package/src/components/RecurringDate.tsx +21 -2
- package/src/schema/recurringDates.tsx +3 -3
- package/src/types.ts +1 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -68,6 +68,9 @@ export default defineConfig({
|
|
|
68
68
|
timeFormat: 'HH:mm',
|
|
69
69
|
timeStep: 15,
|
|
70
70
|
},
|
|
71
|
+
|
|
72
|
+
// Changes the date picker to date only, no time
|
|
73
|
+
dateOnly: true, // defaults to false
|
|
71
74
|
}),
|
|
72
75
|
],
|
|
73
76
|
})
|
|
@@ -102,6 +105,9 @@ defineField({
|
|
|
102
105
|
timeFormat: 'HH:mm',
|
|
103
106
|
timeStep: 15,
|
|
104
107
|
},
|
|
108
|
+
|
|
109
|
+
// Changes the date picker to date only, no time
|
|
110
|
+
dateOnly: true, // defaults to false
|
|
105
111
|
},
|
|
106
112
|
})
|
|
107
113
|
```
|
|
@@ -120,6 +126,18 @@ Here is an example of the data stored on the field after configuring a recurring
|
|
|
120
126
|
|
|
121
127
|
As the plugin uses the standard Sanity `datetime` field type, the start and end dates are stored in UTC. The `rrule` string is in line with the recurrence rules defined in the [iCalendar RFC](https://tools.ietf.org/html/rfc5545), with rules generated by the [rrule.js](https://github.com/jakubroztocil/rrule) library.
|
|
122
128
|
|
|
129
|
+
If you enable the `dateOnly` option, then the time will not be present on the field:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"rrule": "RRULE:FREQ=MONTHLY;INTERVAL=1;BYDAY=+1MO",
|
|
134
|
+
"startDate": "2023-08-01",
|
|
135
|
+
"endDate": "2023-08-01"
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Depending on how you use the data, you may need to append a time to the date before using it on your front-end.
|
|
140
|
+
|
|
123
141
|
### Using the rules on a frontend
|
|
124
142
|
|
|
125
143
|
Whilst displaying the recurring dates on a frontend is beyond the scope of this plugin, there are a couple of considerations worth calling out.
|