i have a problem in laravel with links in a fullcalednar script. I need the links to be only with date: 2022-06-28 not with T00:00:00+03:00. i do this but not work any ideea?
// timeZoneOffset is in minutes
function buildIsoString(marker, timeZoneOffset, stripZeroTime) {
if (stripZeroTime === void 0) { stripZeroTime = false; }
var s = marker.toISOString();
s = s.replace('.000', '');
if (stripZeroTime) {
s = s.replace('T00:00:00Z', '');
}
if (s.length > 10) { // time part wasn't stripped, can add timezone info
if (timeZoneOffset == null) {
s = s.replace('Z', '');
}
else if (timeZoneOffset !== 0) {
s = s.replace('Z', formatTimeZoneOffset(timeZoneOffset, true));
}
// otherwise, its UTC-0 and we want to keep the Z
}
return s;
}
I don't fully understand the problem. So, please bear with me.
If you want to strip the hours, minutes, seconds and miliseconds from an ISO string (from Date.toISOString()) you can simply do the following:
isoString = isoString.slice(0, 10);isoString = isoString.replace(/T.*$/, "");I'm not sure this answers your question. I would need to know more about how and where the buildIsoString function is being called and what the formatTimeZoneOffset does.
I hope this helps.