You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					26 lines
				
				558 B
			
		
		
			
		
	
	
					26 lines
				
				558 B
			| 
											2 years ago
										 | /* eslint-disable */ | ||
|  | function getMonthEndDay(year, month) { | ||
|  |   return 32 -  getDate(year, month - 1, 32).getDate(); | ||
|  | } | ||
|  | 
 | ||
|  | function compareMonth(date1, date2) { | ||
|  |   date1 = getDate(date1); | ||
|  |   date2 = getDate(date2); | ||
|  | 
 | ||
|  |   var year1 = date1.getFullYear(); | ||
|  |   var year2 = date2.getFullYear(); | ||
|  |   var month1 = date1.getMonth(); | ||
|  |   var month2 = date2.getMonth(); | ||
|  | 
 | ||
|  |   if (year1 === year2) { | ||
|  |     return month1 === month2 ? 0 : month1 > month2 ? 1 : -1; | ||
|  |   } | ||
|  | 
 | ||
|  |   return year1 > year2 ? 1 : -1; | ||
|  | } | ||
|  | 
 | ||
|  | module.exports = { | ||
|  |   getMonthEndDay: getMonthEndDay, | ||
|  |   compareMonth: compareMonth | ||
|  | }; |