Commonly used js processing functions, etc.

cool

1) Get the next month of the specified year.

/**
         * Get next month
         *
         * @date format is yyyymm date, such as: 201401
         */        
        function getNextMonth(date) {
            var year = date.substring(0,4); //Get the year of the current date
            var month = date.substring(4,6); //Get the month of the current date
            // Months +1
            var nextMon = parseInt(month) + 1;
            if(nextMon >= 13){
            	nextMon = "01";
            	year = parseInt(year)+1//year+1
            }else if (nextMon < 10) {
            	nextMon = "0" + nextMon;
            }
            var t2 = year + "" + nextMon;
            return t2;
        }

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326490164&siteId=291194637