Hi everyone,
I perform coding in SST timezone and I want to show data in the console.log
However there are errors when I inputted in the Sandcastle…
var TZcode = ‘SST’;
var UTCoffset = new Date();
UTCoffset = -UTCoffset.getTimezoneOffset();
var UTCscratch = new Cesium.JulianDate();
// Date formatting to a global form
function localeDateTimeFormatter(datetime, viewModel, ignoredate) {
if(UTCoffset) datetime = Cesium.JulianDate.addMinutes(datetime, UTCoffset, UTCscratch);
var gregorianDT = Cesium.JulianDate.toGregorianDate(datetime), objDT;
if(ignoredate)
objDT = ‘’;
else {
objDT = new Date(gregorianDT.year, gregorianDT.month-1, gregorianDT.day);
objDT = gregorianDT.day + ’ ’ + objDT.toLocaleString(“en-us”, { month: “short” }) + ’ ’ + gregorianDT.year;
if(viewModel || gregorianDT.hour+gregorianDT.minute === 0)
return objDT;
objDT += ’ ';
}
return objDT + Cesium.sprintf("%02d:%02d "+TZcode, gregorianDT.hour, gregorianDT.minute);
}
There are errors when I inputted in the Cesiumjs Sandcastle…
On this one “if(UTCoffset) datetime = Cesium.JulianDate.addMinutes(datetime, UTCoffset, UTCscratch);”
The error states Expected ‘{’ and instead saw datetime
On this one “objDT = ‘’;”
The error states Expected ‘{’ and instead saw objDT
On this one “return objDT;”
The error states Expected ‘{’ and instead saw return
i cant solve the error sigh…
can you please help me