Skip to content

Instantly share code, notes, and snippets.

@christemple
Created October 31, 2014 10:46
Show Gist options
  • Save christemple/73506e58e87d4e2f797b to your computer and use it in GitHub Desktop.
Save christemple/73506e58e87d4e2f797b to your computer and use it in GitHub Desktop.
Get previous 30 days labels
get_previous_thirty_days_labels_from = (now, callback)->
previous_days = []
for days_to_subtract in [0..29]
previous_days.unshift moment(now).subtract(days_to_subtract, 'day').format("DD")
callback(previous_days)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment