/*获取某年有多少天*/ getYearOfDay (time) { var firstDayYear = this.getFirstDayOfYear(time); var lastDayYear = this.getLastDayOfYear(time); var numSecond = (newDate(lastDayYear).getTime() - newDate(firstDayYear).getTime())/1000; returnMath.ceil(numSecond/(24*3600)); }
/*获取某年的第一天*/ getFirstDayOfYear (time) { var year = newDate(time).getFullYear(); return year + "-01-01 00:00:00"; }
/*获取某年最后一天*/ getLastDayOfYear (time) { var year = newDate(time).getFullYear(); var dateString = year + "-12-01 00:00:00"; var endDay = this.getMonthOfDay(dateString); return year + "-12-" + endDay + " 23:59:59"; }
/*获取某个日期是当年中的第几天*/ getDayOfYear (time) { var firstDayYear = this.getFirstDayOfYear(time); var numSecond = (newDate(time).getTime() - newDate(firstDayYear).getTime())/1000; returnMath.ceil(numSecond/(24*3600)); }