<commit_before>$(document).on('dp.change', '#ds-range-picker-from', function(e) {
  var from = $('#ds-range-picker-from').data("DateTimePicker").getDate()
  console.log('set from time: ' + moment(from).fromNow())
})

$(document).on('dp.change', '#ds-range-picker-until', function(e) {
  var until = $('#ds-range-picker-until').data("DateTimePicker").getDate()
  console.log('set until time: ' + moment(until).fromNow())
})

$(document).on('click', '.ds-recent-range-picker li, .ds-recent-range-picker a, .ds-custom-range-picker ul li, .ds-custom-range-picker ul li a', function(e) {
  var range = $(e.target).attr('data-ds-range')
  console.log(range)

  if (range === 'custom') {
    $('.ds-recent-range-picker').hide()
    $('.ds-custom-range-picker').show()

    var now = moment() // TODO: quantize to 15-min interval
    $('#ds-range-picker-until').data("DateTimePicker").setDate(now)
    // set to now -3 hours
    // $('#ds-range-picker-from').data("DateTimePicker").setDate(moment())

  } else if (range === 'recent') {
    $('.ds-custom-range-picker').hide()
    $('.ds-recent-range-picker').show()

  } else {
    ds.manager.set_time_range(range, null)
  }
    return false
})
<commit_msg>Use UTC, quantize to 15-minute intervals<commit_after>$(document).on('dp.change', '#ds-range-picker-from', function(e) {
  var from = $('#ds-range-picker-from').data("DateTimePicker").getDate()
  console.log('set from time: ' + moment(from).fromNow())
})

$(document).on('dp.change', '#ds-range-picker-until', function(e) {
  var until = $('#ds-range-picker-until').data("DateTimePicker").getDate()
  console.log('set until time: ' + moment(until).fromNow())
})

$(document).on('click', '.ds-recent-range-picker li, .ds-recent-range-picker a, .ds-custom-range-picker ul li, .ds-custom-range-picker ul li a', function(e) {
  var range = $(e.target).attr('data-ds-range')

  if (range === 'custom') {
    $('.ds-recent-range-picker').hide()
    $('.ds-custom-range-picker').show()

    var now          = moment().utc().startOf('minute')
    now.minute( Math.round(now.minute() / 15) * 15) // quantize to 15-min interval
    var until_picker = $('#ds-range-picker-until').data("DateTimePicker")
    until_picker.setDate(now)
    until_picker.setMaxDate(now.endOf('day'))

    // set to now -3 hours
    // $('#ds-range-picker-from').data("DateTimePicker").setDate(moment())

  } else if (range === 'recent') {
    $('.ds-custom-range-picker').hide()
    $('.ds-recent-range-picker').show()

  } else {
    ds.manager.set_time_range(range, null)
  }
    return false
})

{'fraction_non_alphanumeric': 0.22525331254871395, 'fraction_numerical': 0.004676539360872954, 'mean_word_length': 3.8161350844277675, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6936383', 'n_tokens_mistral': 892, 'n_tokens_neox': 863, 'n_words': 147}