Last active
August 29, 2015 14:08
-
-
Save tomkis/898794c227670d199e78 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// incorrect, does not work for the exact midnight | |
var today = moment(), | |
yesterday = moment().subtract(1, 'days'); | |
// correct but ugly | |
var today = moment(), | |
yesterday = today.clone().subtract(1, 'days'); | |
// pretty but unable to write with momentjs because instance is not immutable | |
var today = moment(), | |
yesterday = today.subtract(1, 'days'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment