Skip to content

Instantly share code, notes, and snippets.

@sauntimo
Created November 13, 2012 22:24
Show Gist options
  • Save sauntimo/4068845 to your computer and use it in GitHub Desktop.
Save sauntimo/4068845 to your computer and use it in GitHub Desktop.
Google Apps Script Date Input handler
// Create string version of date entered to be read by humans
NewSubmission["Delivery Date"] = NewSubmission["Day"] + "-" + NewSubmission["Month"] + "-" + NewSubmission["Year"];
// create Javascript Date instance from date string
var OrderFor = new Date(NewSubmission["Month"] + " " + NewSubmission["Day"] + ", " + NewSubmission["Year"]);
// These properties aren't needed as we have NewSubmission["Delivery Date"] which is DD-MM-YYYY
delete NewSubmission["Day"];
delete NewSubmission["Month"];
delete NewSubmission["Year"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment