functions/index.js
//function to convert date string to date time local string
function to convert date string to date time local string
function to convert date string to date time local string
function toDateTimeLocalString(dateString) {
	if (!dateString) {
		return null
	}
	var date = new Date(Date.parse(dateString));
	var string = date.getFullYear() + "-";
	string += toDoubleDigit(date.getMonth() + 1) + "-";
	string += toDoubleDigit(date.getDate()) + "T";
	string += toDoubleDigit(date.getHours()) + ":";
	string += toDoubleDigit(date.getMinutes()) + ":";
	string += toDoubleDigit(date.getSeconds()) + ".";
	string += toDoubleDigit(date.getMilliseconds());
	return string;
}
function toDateTimeLocalString ( dateString ) { if ( ! dateString ) { return null } var date = new Date ( Date . parse ( dateString ) ) ; var string = date . getFullYear ( ) + "-" ; string += toDoubleDigit ( date . getMonth ( ) + 1 ) + "-" ; string += toDoubleDigit ( date . getDate ( ) ) + "T" ; string += toDoubleDigit ( date . getHours ( ) ) + ":" ; string += toDoubleDigit ( date . getMinutes ( ) ) + ":" ; string += toDoubleDigit ( date . getSeconds ( ) ) + "." ; string += toDoubleDigit ( date . getMilliseconds ( ) ) ; return string ; }
function to convert date string to date time local string
function to convert date string to date time local string