Skip to content

Instantly share code, notes, and snippets.

@hideack
Created February 21, 2015 08:38
Show Gist options
  • Save hideack/987b7c3bf865f090149e to your computer and use it in GitHub Desktop.
Save hideack/987b7c3bf865f090149e to your computer and use it in GitHub Desktop.
moment.jsで1日前の日時を取得
> moment().add('days', -1).format("YYYY-MM-DD")
'2015-02-20'
> moment().add('days', -2).format("YYYY-MM-DD")
'2015-02-19'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment