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

META-INF.resources.bower_components.globalize.src.util.date.set-month.js Maven / Gradle / Ivy

There is a newer version: 1.2.2.1-jre17
Show newest version
define([
    "./set-date"
], function (dateSetDate) {

    /**
     * Differently from native date.setMonth(), this function adjusts date if
     * needed, so final month is always the one set.
     *
     * setMonth( Jan31Date, 1 ): a "Feb 28" date.
     * setDate( Jan31Date, 8 ): a "Sep 30" date.
     */
    return function (date, month) {
        var originalDate = date.getDate();

        date.setDate(1);
        date.setMonth(month);
        dateSetDate(date, originalDate);
    };

});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy