@instawork/design-system
Version:
The design system for Instawork's web apps
29 lines • 1.23 kB
JavaScript
/**
* Data structure used by {@link TimeRangeComponent} to represent the current duration value, as well as the diff as
* compared to the original duration value of the time inputs.
*/
export class TimeRangeDurationState {
/**
*
* @param current - The current duration value based on the current values of start and end inputs
* @param original - The original duration based on the original values of the start and end inputs
* @param diff - The difference between the current and original durations
* @param crossesMidnight - Whether the time range crosses midnight (into the next day)
* @param offsetChange - The change in time zone offset, if any (e.g. due to entering or leaving DST)
*/
constructor(current, original, diff, crossesMidnight = false, offsetChange = 0) {
this.current = current;
this.original = original;
this.diff = diff;
this.current = current;
this.original = original;
this.diff = diff;
if (crossesMidnight || offsetChange) {
this.info = {
crossesMidnight,
offsetChange,
};
}
}
}
//# sourceMappingURL=time-range-duration-state.js.map