@stoker-platform/web-app 0.5.41 → 0.5.42
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/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/Form.tsx +27 -14
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/Form.tsx
CHANGED
|
@@ -1247,20 +1247,33 @@ function TimestampField({
|
|
|
1247
1247
|
form={form}
|
|
1248
1248
|
/>
|
|
1249
1249
|
<FormControl>
|
|
1250
|
-
<div className="flex
|
|
1251
|
-
<
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1250
|
+
<div className="flex flex-col gap-2">
|
|
1251
|
+
<div className="flex w-fit flex-col gap-2 rounded-md border border-input">
|
|
1252
|
+
<MonthPicker
|
|
1253
|
+
currentMonth={
|
|
1254
|
+
currentValue
|
|
1255
|
+
? keepTimezone(currentValue.toJSDate(), timezone)
|
|
1256
|
+
: keepTimezone(new Date(), timezone)
|
|
1257
|
+
}
|
|
1258
|
+
onMonthChange={(date: Date | undefined) => {
|
|
1259
|
+
if (!date) return
|
|
1260
|
+
const newDate = DateTime.fromJSDate(date).setZone(timezone)
|
|
1261
|
+
formField.onChange(Timestamp.fromDate(newDate.toJSDate()))
|
|
1262
|
+
}}
|
|
1263
|
+
disabled={isDisabled}
|
|
1264
|
+
/>
|
|
1265
|
+
</div>
|
|
1266
|
+
{formField.value && (
|
|
1267
|
+
<Button
|
|
1268
|
+
type="button"
|
|
1269
|
+
variant="outline"
|
|
1270
|
+
onClick={() => formField.onChange(null)}
|
|
1271
|
+
disabled={isDisabled}
|
|
1272
|
+
className="w-fit"
|
|
1273
|
+
>
|
|
1274
|
+
Clear
|
|
1275
|
+
</Button>
|
|
1276
|
+
)}
|
|
1264
1277
|
</div>
|
|
1265
1278
|
</FormControl>
|
|
1266
1279
|
{description && <FormDescription>{description}</FormDescription>}
|