IO-1721 Update time ticket time fields to be in 5 minute increments.

This commit is contained in:
Patrick Fic
2022-02-14 10:41:09 -08:00
parent b84935efdc
commit f884d2e23f
2 changed files with 19 additions and 17 deletions

View File

@@ -19,17 +19,16 @@ const DateTimePicker = (
return ( return (
<div id={id}> <div id={id}>
<FormDatePicker <FormDatePicker
{...restProps}
{...(onlyFuture && { {...(onlyFuture && {
disabledDate: (d) => moment().subtract(1, "day").isAfter(d), disabledDate: (d) => moment().subtract(1, "day").isAfter(d),
})} })}
value={value} value={value}
onBlur={onBlur} onBlur={onBlur}
onChange={onChange} onChange={onChange}
{...restProps}
/> />
<TimePicker <TimePicker
{...restProps}
value={value ? moment(value) : null} value={value ? moment(value) : null}
{...(onlyFuture && { {...(onlyFuture && {
disabledDate: (d) => moment().isAfter(d), disabledDate: (d) => moment().isAfter(d),
@@ -39,6 +38,7 @@ const DateTimePicker = (
minuteStep={15} minuteStep={15}
onBlur={onBlur} onBlur={onBlur}
format="hh:mm a" format="hh:mm a"
{...restProps}
/> />
</div> </div>
); );

View File

@@ -212,6 +212,7 @@ export function TimeTicketModalComponent({
<> <>
<Form.Item label={t("timetickets.fields.clockon")} name="clockon"> <Form.Item label={t("timetickets.fields.clockon")} name="clockon">
<FormDateTimePicker <FormDateTimePicker
minuteStep={5}
disabled={ disabled={
!HasRbacAccess({ !HasRbacAccess({
bodyshop, bodyshop,
@@ -245,6 +246,7 @@ export function TimeTicketModalComponent({
]} ]}
> >
<FormDateTimePicker <FormDateTimePicker
minuteStep={5}
disabled={ disabled={
!HasRbacAccess({ !HasRbacAccess({
bodyshop, bodyshop,