mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-16 21:03:29 +00:00
refactor: recover day after indicator
This commit is contained in:
committed by
Carlos Valente
parent
4069038ed5
commit
eb2c4d0780
@@ -65,6 +65,9 @@ export { validateEndAction, validateTimerType } from './src/validate-events/vali
|
||||
|
||||
// feature business logic
|
||||
|
||||
// feature business logic - rundown
|
||||
export { checkIsNextDay } from './src/date-utils/checkIsNextDay.js';
|
||||
|
||||
// feature business logic - spreadsheet import
|
||||
export {
|
||||
type ImportCustom,
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Utility function checks whether a given event is the day after from its predecessor
|
||||
* We consider an event to be the day after, if it begins before the start of the previous
|
||||
* @example day after
|
||||
* 09:00 - 10:00
|
||||
* 08:00 - 10:30
|
||||
* @example same day
|
||||
* 09:00 - 10:00
|
||||
* 09:30 - 10:30
|
||||
*/
|
||||
export function checkIsNextDay(previousStart: number, timeStart: number): boolean {
|
||||
return timeStart <= previousStart;
|
||||
}
|
||||
Reference in New Issue
Block a user