MCPcopy
hub / github.com/flatpickr/flatpickr / compareTimes

Function compareTimes

src/utils/dates.ts:144–151  ·  view source on GitHub ↗
(date1: Date, date2: Date)

Source from the content-addressed store, hash-verified

142 * Compute the difference in times, measured in ms
143 */
144export function compareTimes(date1: Date, date2: Date) {
145 return (
146 3600 * (date1.getHours() - date2.getHours()) +
147 60 * (date1.getMinutes() - date2.getMinutes()) +
148 date1.getSeconds() -
149 date2.getSeconds()
150 );
151}
152
153export const isBetween = (ts: number, ts1: number, ts2: number) => {
154 return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);

Callers 1

onChangeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…