How to use the date-format.shortTime function in date-format

To help you get started, we’ve selected a few date-format examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Alfresco / share-old / share / src / main / webapp / components / calendar / eventinfo.js View on Github external
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"]);
                     }
                  });
github Alfresco / share / share / src / main / webapp / components / calendar / eventinfo.js View on Github external
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"]);
                     }
                  });
github Alfresco / share / share / src / main / webapp / components / calendar / eventinfo.js View on Github external
{
                        // 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"]);
                     }
                  });
github Alfresco / share-old / share / src / main / webapp / components / calendar / eventinfo.js View on Github external
{
                        // 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"]);
                     }
                  });

date-format

Formatting Date objects as strings since 2013

MIT
Latest version published 2 years ago

Package Health Score

71 / 100
Full package analysis