I have a snippet which is prepopulating a dateTime field, from a previous row in the same model, OR if there are no previous rows, then date should be null and time 00:00
This seems to be working fine in our dev org and packaging org, but in a test org the ‘time’ component (which should be 00:00) actually varies according to the user’s time zone setting.
How it looks in the dev org when first row is populated:
How it looks in the test org when first row is populated: (user’s time zone set to GMT+2)
How it looks in the test org when user’s time zone is reset to GMT+10
Any ideas as to why this could be happening? And how to make this snippet populate a 00:00 value for the time (across multiple orgs and user time zone variations)
Snippet below:
var $ = skuid.$, params = arguments 0],<br> model = params.model,<br> <br>// Create a new row in our Model,<br>// with the stack__Date__c field defaulted to the same date as the last row in the table <br>rows = model.getRows(),<br>numRows = rows.length,<br>defaultDate;<br> // If we have a previous row, default it to that rows date <br>if (numRows) defaultDate = rowsanumRows-1].stack__Date__c;<br> // Otherwise default it to NOW / TODAY<br> //else defaultDate = 'TODAY';<br>else defaultDate = null;<br>//Create the row<br>model.createRow({<br> additionalConditions:o<br> {field: 'stack__Date__c', value: defaultDate}<br> ],<br> editModeForNewItems: true,<br> doAppend: true<br>});