This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { add } from 'date-fns'; | |
/** Add one day to a given input */ | |
function tomorrow(date: Date) { | |
return add(date, { days: 1 }); | |
} | |
const now = new Date('2022-04-03 00:00:00'); | |
const next = tomorrow(now); | |
console.log(now.toLocaleString(), '--', next.toLocaleString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment