File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import type { PayrollType } from './PayrollList/types'
1313import { formatPayRate } from '@/helpers/formattedStrings'
1414import { useLocale } from '@/contexts/LocaleProvider/useLocale'
1515import { COMPENSATION_NAME_REIMBURSEMENT , FlsaStatus } from '@/shared/constants'
16-
16+ import { MS_PER_HOUR } from '@/helpers/dateFormatting'
1717const REGULAR_HOURS_NAME = 'regular hours'
1818
1919// Utility to get the primary job from an employee
@@ -635,10 +635,8 @@ export const canCancelPayroll = (payroll: Payroll): boolean => {
635635 const now = new Date ( )
636636 const deadline = new Date ( payroll . payrollDeadline )
637637
638- const nowInPT = new Date ( now . getTime ( ) + getPacificTimeOffset ( now ) * 60 * 60 * 1000 )
639- const deadlineInPT = new Date (
640- deadline . getTime ( ) + getPacificTimeOffset ( deadline ) * 60 * 60 * 1000 ,
641- )
638+ const nowInPT = new Date ( now . getTime ( ) + getPacificTimeOffset ( now ) * MS_PER_HOUR )
639+ const deadlineInPT = new Date ( deadline . getTime ( ) + getPacificTimeOffset ( deadline ) * MS_PER_HOUR )
642640
643641 const cutoffTime = new Date ( deadlineInPT )
644642 cutoffTime . setUTCHours ( 16 , 0 , 0 , 0 )
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ export const normalizeDateToLocal = (date: Date | null): Date | null => {
200200 return new Date ( year , month - 1 , day )
201201}
202202
203- const MS_PER_HOUR = 1000 * 60 * 60
203+ export const MS_PER_HOUR = 1000 * 60 * 60
204204const MS_PER_DAY = MS_PER_HOUR * 24
205205
206206export const getHoursUntil = ( deadline ?: Date | string | null ) : number | null => {
You can’t perform that action at this time.
0 commit comments