Last active
February 21, 2022 22:02
-
-
Save basarat/ecf35de130c383707edc68c52f5187b2 to your computer and use it in GitHub Desktop.
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