refactor: recover day after indicator

This commit is contained in:
Carlos Valente
2024-05-17 22:38:31 +02:00
committed by Carlos Valente
parent 4069038ed5
commit eb2c4d0780
5 changed files with 22 additions and 18 deletions
+3
View File
@@ -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;
}