I'm having a strange problem trying to get the date value returned from the PRIM_MD.DateTime control.
When the users selects a date from the calendar it correctly displays on the screen, however when I try and assign the value to another field it always displays the previous days date.
I'm in the UK could this be a timezone issue?
User selects 8th June 2020 After Clicking save I can see the value of the control using a console log The value is showing as 7th June 2020
Here's the relevant code
Code: Select all
Define_Com Class(#PRIM_MD.DateTime) Name(#ResponseDate) Caption('Date') Displayposition(2) Icon('date_range') Iconopacity(50) Left(253) Parent(#AnswerPanel) Tabposition(3) Width(300) Themedrawstyle('LightTitle') Top(46) Dateformat(Custom) Customdateformat('DDDD, D MMM YYYY')
Evtroutine Handling(#SaveResponse.Click)
#ApptDateFormat := #ResponseDate.value.AsDisplayString( CCYYMMDDHHMMSS )
#ApptDatex := #ResponseDate.Value
#SYS_WEB.console.log Text('Save Clicked Date - ' + #ApptDatex.AsString + ' - ' + #ApptSlot)
#SYS_WEB.console.log Text('Date Format - ' + #ApptDateFormat)
Endroutine
I'm at the point of forgetting the control altogether and just having the user type the date.
Cheers
Paul.