Hi Dan! Awesome little package you've made. I just got a small problem. Using Umbraco 7.1.8 i tried "Initialise with Current Date?". It looks like it works, the field gets populated but when trying GetPropertyValue<Diplo.DateRangePicker.DateRange>("dateRange") it's just blank.
If i press the datepicker and just hit "apply" it saves just fine.
else if (initialiseCurrent) {
var startDate = moment();
var endDate = moment().add('days', 1);
$(dateBox).val(startDate.format(dateFormat) + " - " + endDate.format(dateFormat));
$("#diplo-drp-json-" + $scope.model.alias).val(startDate.format(uFormat) + "," + endDate.format(uFormat)).trigger('input');
}
You'll need to force-reload the page to ensure the JS changes get picked up. I normally use Chrome Dev tools (f12) and go to settings (gear icon) and tick the "disable cache when dev tools open" - then force reload. You can also try restarting app pool. This should fix it.
Can't get "populated" date
Hi Dan! Awesome little package you've made. I just got a small problem. Using Umbraco 7.1.8 i tried "Initialise with Current Date?". It looks like it works, the field gets populated but when trying
GetPropertyValue<Diplo.DateRangePicker.DateRange>("dateRange")
it's just blank.If i press the datepicker and just hit "apply" it saves just fine.
Hi Johan!
Good spot, I think you've found a bug :) However, there should be a quick fix...
Go to the /App_Plugins/DateRangePicker/ folder and open daterangepicker.controller.js in a text editor. Find line 49 which should be:
Directly after this add the following line:
So the entire block should look like:
You'll need to force-reload the page to ensure the JS changes get picked up. I normally use Chrome Dev tools (f12) and go to settings (gear icon) and tick the "disable cache when dev tools open" - then force reload. You can also try restarting app pool. This should fix it.
Thanks for taking time to report this.
Dan
Thanks! Just a heads up. This sets the current time too. That may be something that you don't want. Easy to reset to 00:00:00 though :)
is working on a reply...