Counts the whole calendar days from start to end. Negative when end is before start. Add 1 for an inclusive count of the days in the range.
start
end
1
import {createUtcFullDate, diffDateOnlyDays, toDateOnlyUtcIsoString} from 'date-vir';diffDateOnlyDays({ start: toDateOnlyUtcIsoString(createUtcFullDate('2026-10-02T00:00:00.000Z')), end: toDateOnlyUtcIsoString(createUtcFullDate('2026-10-05T00:00:00.000Z')),}); // outputs `3` Copy
import {createUtcFullDate, diffDateOnlyDays, toDateOnlyUtcIsoString} from 'date-vir';diffDateOnlyDays({ start: toDateOnlyUtcIsoString(createUtcFullDate('2026-10-02T00:00:00.000Z')), end: toDateOnlyUtcIsoString(createUtcFullDate('2026-10-05T00:00:00.000Z')),}); // outputs `3`
Counts the whole calendar days from
starttoend. Negative whenendis beforestart. Add1for an inclusive count of the days in the range.