All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.globalize.src.date.day-of-week.js Maven / Gradle / Ivy

The newest version!
define(function () {

    /**
     * dayOfWeek( date, firstDay )
     *
     * @date
     *
     * @firstDay the result of `dateFirstDayOfWeek( cldr )`
     *
     * Return the day of the week normalized by the territory's firstDay [0-6].
     * Eg for "mon":
     * - return 0 if territory is GB, or BR, or DE, or FR (week starts on "mon");
     * - return 1 if territory is US (week starts on "sun");
     * - return 2 if territory is EG (week starts on "sat");
     */
    return function (date, firstDay) {
        return (date.getDay() - firstDay + 7) % 7;
    };

});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy