Date/time fields
Use the date/time fields to allow users to set dates, saved as Firestore timestamps.
You can choose between using dates or date/time fields. Also you can create read-only fields that get updated automatically when entities are created or updated
The data type is date
.
Internally the component used
is DateTimeFieldBinding
.
Date field
import { buildProperty } from "@firecms/cloud";
buildProperty({
dataType: "date",
name: "Expiry date",
mode: "date"
});
Date/time field
import { buildProperty } from "@firecms/cloud";
buildProperty({
dataType: "date",
name: "Arrival time",
mode: "date_time"
});
Update on creation
import { buildProperty } from "@firecms/cloud";
buildProperty({
dataType: "date",
name: "Created at",
autoValue: "on_create"
});
Update on update
import { buildProperty } from "@firecms/cloud";
buildProperty({
dataType: "date",
name: "Updated at",
autoValue: "on_update"
});