jhanajc Posted October 5, 2015 Report Share Posted October 5, 2015 Is it possible to call the Caspio data picker from an HTML block? I notice the HTML5 date picker throws an error as it wants yyyy-mm-dd format and the Casio localisation is dd/mm/yyyy format. Thanks Jon Quote Link to comment Share on other sites More sharing options...
0 Aurora Posted October 5, 2015 Report Share Posted October 5, 2015 Hi Jon What if you try to change Caspio localization to that one you need. i know it is possible to set yyyy-mm-dd format for date fields. Please try and let us know if it works. Aurora Quote Link to comment Share on other sites More sharing options...
0 jhanajc Posted October 6, 2015 Author Report Share Posted October 6, 2015 Hi Aurora, Thanks, I checked the localization, it looks alright but it still not behaving correctly. I removed the date picker and turned the form field into a standard text field so I could see what's happening, it seems there is an additional issue. For example: On the web page I'm forced to enter the date as 29/05/2015 When I read the date back to the page it is 05/29/2015 When you look in the table it is 05/29/2015 Caspio localization is set to English UK with default settings. Thanks Quote Link to comment Share on other sites More sharing options...
0 jhanajc Posted October 6, 2015 Author Report Share Posted October 6, 2015 Here's a workaround to flip the mm/dd/yyyy format (displayed) to dd/mm/yyyy pasted into the footer: <script> function ukDateFormat (DateTxt) { DateVar = DateTxt; var DateVar = new Date(DateVar); var dd = DateVar.getDate(); var mm = DateVar.getMonth()+1; var yyyy = DateVar.getFullYear(); if(dd<10){ dd='0'+dd } if(mm<10){ mm='0'+mm } var DateVar = dd+'/'+mm+'/'+yyyy; document.getElementById("MY_INPUT_DATE_FIELD_ID").value = DateVar; } ukDateFormat ('[@field:MY_CASPIO_DATE_FIELD]') </script> I will have another look to see if it fixes the date picker issue. Quote Link to comment Share on other sites More sharing options...
0 jhanajc Posted October 7, 2015 Author Report Share Posted October 7, 2015 The the resulting date from the above script displays perfectly in Chrome. However in Explorer we get NaN/NaN/NaN despite all attempts to force the date to a text string, ( NaN = Not A Number) Is it possible to make the date to display correctly in Explorer? Thanks Quote Link to comment Share on other sites More sharing options...
Question
jhanajc
Is it possible to call the Caspio data picker from an HTML block?
I notice the HTML5 date picker throws an error as it wants yyyy-mm-dd format and the Casio localisation is dd/mm/yyyy format.
Thanks
Jon
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.