Skip to content

Instantly share code, notes, and snippets.

@adammiribyan
Created November 7, 2016 17:20
Show Gist options
  • Save adammiribyan/d20f5d971db17393573dc99ff8daeed9 to your computer and use it in GitHub Desktop.
Save adammiribyan/d20f5d971db17393573dc99ff8daeed9 to your computer and use it in GitHub Desktop.
$(document).on 'turbolinks:load', ->
$('#export_from').datepicker('update', moment().format('DD-MM-Y'))
$('#export_until').datepicker('update', moment().format('DD-MM-Y'))
$('[data-behavior~=back_30_days]').on 'change', (e) ->
$('.back-in-time').hide('slow')
$("#{$(e.target).data('target')}").datepicker('update', moment().subtract(30, 'days').format('DD-MM-Y'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment