Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Dom.addClass(document.getElementsByName('start')[0].parentNode, "hidden")
Dom.addClass(document.getElementsByName('end')[0].parentNode, "hidden")
} else
{
// show them if they are.
Dom.removeClass(document.getElementsByName('start')[0].parentNode, "hidden")
Dom.removeClass(document.getElementsByName('end')[0].parentNode, "hidden")
//Set default start/end dates to prevent AllDay event(see MNT-9498)
//Format date by pattern (see MNT-12811)
var tmpDate = new Date();
tmpDate.setHours(12);
tmpDate.setMinutes(0);
document.getElementsByName('start')[0].value=Alfresco.util.formatDate(tmpDate, Alfresco.messages.global["date-format.shortTime"]);
tmpDate.setHours(13);
document.getElementsByName('end')[0].value=Alfresco.util.formatDate(tmpDate, Alfresco.messages.global["date-format.shortTime"]);
}
});
Dom.addClass(document.getElementsByName('start')[0].parentNode, "hidden")
Dom.addClass(document.getElementsByName('end')[0].parentNode, "hidden")
} else
{
// show them if they are.
Dom.removeClass(document.getElementsByName('start')[0].parentNode, "hidden")
Dom.removeClass(document.getElementsByName('end')[0].parentNode, "hidden")
//Set default start/end dates to prevent AllDay event(see MNT-9498)
//Format date by pattern (see MNT-12811)
var tmpDate = new Date();
tmpDate.setHours(12);
tmpDate.setMinutes(0);
document.getElementsByName('start')[0].value=Alfresco.util.formatDate(tmpDate, Alfresco.messages.global["date-format.shortTime"]);
tmpDate.setHours(13);
document.getElementsByName('end')[0].value=Alfresco.util.formatDate(tmpDate, Alfresco.messages.global["date-format.shortTime"]);
}
});
{
// hide time boxes if they're not relevent.
Dom.addClass(document.getElementsByName('start')[0].parentNode, "hidden")
Dom.addClass(document.getElementsByName('end')[0].parentNode, "hidden")
} else
{
// show them if they are.
Dom.removeClass(document.getElementsByName('start')[0].parentNode, "hidden")
Dom.removeClass(document.getElementsByName('end')[0].parentNode, "hidden")
//Set default start/end dates to prevent AllDay event(see MNT-9498)
//Format date by pattern (see MNT-12811)
var tmpDate = new Date();
tmpDate.setHours(12);
tmpDate.setMinutes(0);
document.getElementsByName('start')[0].value=Alfresco.util.formatDate(tmpDate, Alfresco.messages.global["date-format.shortTime"]);
tmpDate.setHours(13);
document.getElementsByName('end')[0].value=Alfresco.util.formatDate(tmpDate, Alfresco.messages.global["date-format.shortTime"]);
}
});
{
// hide time boxes if they're not relevent.
Dom.addClass(document.getElementsByName('start')[0].parentNode, "hidden")
Dom.addClass(document.getElementsByName('end')[0].parentNode, "hidden")
} else
{
// show them if they are.
Dom.removeClass(document.getElementsByName('start')[0].parentNode, "hidden")
Dom.removeClass(document.getElementsByName('end')[0].parentNode, "hidden")
//Set default start/end dates to prevent AllDay event(see MNT-9498)
//Format date by pattern (see MNT-12811)
var tmpDate = new Date();
tmpDate.setHours(12);
tmpDate.setMinutes(0);
document.getElementsByName('start')[0].value=Alfresco.util.formatDate(tmpDate, Alfresco.messages.global["date-format.shortTime"]);
tmpDate.setHours(13);
document.getElementsByName('end')[0].value=Alfresco.util.formatDate(tmpDate, Alfresco.messages.global["date-format.shortTime"]);
}
});