I created the following method to use 2 global text fields to search a date range. When I run the method I get an error saying the ‘set.Hours is not a function’
var d1 = globals.Text13
d1.setHours(00)
d1.setMinutes(00)
d1.setSeconds(00)
var df1 = utils.dateFormat(d1, ‘MM-dd-yyyy hh:mm:ss’)
var d2 = globals.Text14
d1.setHours(00)
d1.setMinutes(00)
d1.setSeconds(00)
var df2 = utils.dateFormat(d2, ‘MM-dd-yyyy hh:mm:ss’)
forms.Allottments.controller.show();
var startdate = globals.arrivalDate
startdate.setHours(00)
startdate.setMinutes(00)
startdate.setSeconds(00)
var thestart = utils.dateFormat(startdate, 'MM-dd-yyyy HH:mm:ss')
var enddate = globals.arrivalDate2
enddate.setHours(00)
enddate.setMinutes(00)
enddate.setSeconds(00)
var theend = utils.dateFormat(enddate, 'MM-dd-yyyy HH:mm:ss')
var hotel = globals.searchHotelInt
forms.Allottments.controller.find;
forms.Allottments.allocatedate = thestart + '...' + theend+ '|MM-dd-yyyy HH:mm:ss';
forms.Allottments.locationid = hotel;
forms.Allottments.controller.search;
Both my global fields are datetime fields. The allocatedate field is formatted as MM-dd-yyyy but everytime I run this search I get the following error:
Setting dataprovider with name 'allocatedate' / type 'DATETIME' with value of wrong type 02-08-2005 00:00:00...02-15-2005 00:00:00|MM-dd-yyyy HH:mm:ss