Skip to Navigation

Reply to comment

BUG: This Script fails to copy field with type "TimeOfDay"

It appears that importable fields of type "TimeOfDay" are _reported_ in milliseconds since midnight, e.g. 77400000 for 9:30 PM.Unfortunately, API_importfromCSV is not able to use this format for importing new records. The result is that TimeOfDay data is NOT copied over into duplicated records.

For my implementation, I coded a workaround that converts the time of day to 24-hour HH:MM before resubmitting it. This block of code is added alongside the other data-scrubbing blocks (there is one for data type "UserID", and another for data type "Duration").

else if(data != "" && qdb.selectSingleNode(parentRecord, 
"/*/table/fields/field[@id=" + fid + "][@field_type='timeofday']"))
hour = (data/ 60 / 60 / 1000) - ( (data/ 60 / 60 / 1000) % 1);
minute = ((data-(hour*60*60*1000)) / 60000 ) - (((data-(hour*60*60*1000)) / 60000 ) % 1);
if (minute < 10)
data = hour+":"+minute;
alert("Processing: time of day will be stored as "+data);


The content of this field is kept private and will not be shown publicly.
Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.

© 2016 QuickBase, Inc. All Rights Reserved.

Online Database VeriSign Secured Web Based Software TRUSTe Certification Online Database SSAE Audit