Skip to content

Instantly share code, notes, and snippets.

@lancegliser
Created October 23, 2017 16:04
Show Gist options
  • Select an option

  • Save lancegliser/cdb29fd68c8aa301cc9b21f7cc513338 to your computer and use it in GitHub Desktop.

Select an option

Save lancegliser/cdb29fd68c8aa301cc9b21f7cc513338 to your computer and use it in GitHub Desktop.
// The date input stores the time in local timezone format
// To output the string 'as it appears' rather than shifted by local
// We have to shift the date by the offset before displaying it
var displayDate = field.valueAsDate;
displayDate.setMinutes(displayDate.getTimezoneOffset());
return displayDate.toLocaleDateString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment