|
@@ -41,16 +41,41 @@ function viewMap () {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- $('body').on('click', '.btn-elimina', function onCancella (evt) {
|
|
|
- var rid = $('#dialog').data('rid')
|
|
|
- console.log('cancelliamo?', rid)
|
|
|
- $.post('/api/rapporti/delete', { rid: rid }, function () {
|
|
|
- map.removeLayer($('#dialog').data('marker'))
|
|
|
- $('#dialog').dialog('close')
|
|
|
+ $('body').on('click', '.btn-elimina', function onCancella (evt) {
|
|
|
+ var rid = $('#dialog').data('rid')
|
|
|
+ console.log('cancelliamo?', rid)
|
|
|
+ $.post('/api/rapporti/delete', { rid: rid }, function () {
|
|
|
+ map.removeLayer($('#dialog').data('marker'))
|
|
|
+ $('#dialog').dialog('close')
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
}
|
|
|
jQuery(function ($) {
|
|
|
+ var dateFormat = "yy-mm-dd";
|
|
|
+ function getDate( element ) {
|
|
|
+ var date;
|
|
|
+ try {
|
|
|
+ date = $.datepicker.parseDate( dateFormat, element.value )
|
|
|
+ } catch( error ) {
|
|
|
+ date = null
|
|
|
+ }
|
|
|
+
|
|
|
+ return date
|
|
|
+ }
|
|
|
$('#mapid').css('height', $(window).height() - 200)
|
|
|
+ var from=$('input[name=created__gt]').datepicker({defaultDate: "-1month",
|
|
|
+ changeMonth: true, numberOfMonths: 1,
|
|
|
+ dateFormat: dateFormat
|
|
|
+ }
|
|
|
+ ).on("change", function() {
|
|
|
+ to.datepicker("option", "minDate", getDate(this));
|
|
|
+ })
|
|
|
+ var to = $('input[name=created__lt]').datepicker({
|
|
|
+ defaultDate: "+1d", changeMonth: true, numberOfMonths: 1,
|
|
|
+ dateFormat: dateFormat
|
|
|
+ }
|
|
|
+ ).on("change", function() {
|
|
|
+ from.datepicker("option", "maxDate", getDate(this))
|
|
|
+ })
|
|
|
viewMap()
|
|
|
})
|