anchor.diff:    });
   
     $('input[name="type"]').change(function(){
  +    if ($(this).val() == 'chart') {
  +      $('#singledate').addClass('hidden')
  +      $('#tofrom').removeClass('hidden')
  +    } else {
  +      $('#singledate').removeClass('hidden')
  +      $('#tofrom').addClass('hidden')
  +    }
       updateEmbedCode({
         type: $(this).val()
       })
     })
   
  -  $('input[name="oldest"], input[name="newest"]').on('dp.change', function() {
  -    updateEmbedCode({}, $('input[name="oldest"]').val(), $('input[name="newest"]').val())
  -  })
   })
   </script>
  
positive.code:   $('#from-date').on('dp.change', function (e) {
      $('#to-date').data('DateTimePicker').minDate(e.date)
    })
    $('#to-date').on('dp.change', function (e) {
      $('#from-date').data('DateTimePicker').maxDate(e.date)
    })
  
negative.code:   var format = 'YYYY-MM-DD HH:mm:ss'
    setEmbedCode()
    callFromToDatePicker(format, '<%= @from %>', '<%= @to %>', '<%= @earliest_date %>')
    callDatePicker(format, '<%= @to %>', '<%= @earliest_date %>')
  
    var picker = $('#boxcolour, #textcolour').colorpicker()
  
  