Changeset 155 for trunk/SRC/Calendar/daysinmonth.pro
- Timestamp:
- 08/11/06 16:32:05 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Calendar/daysinmonth.pro
r150 r155 9 9 ; @categories calendar 10 10 ; 11 ; @param month {in}{optional}{default=from "time" common variable of cm_4cal} 12 ; Scalar or array giving the month number for which we want to know the 13 ; number of days 14 ; 11 15 ; @param year {in}{optional}{default=from "time" common variable of cm_4cal} 12 ; To specify the year of the onth. Used only if the common variable16 ; To specify the year of the month. Used only if the common variable 13 17 ; key_caltype = 'greg'. In that case, month and year must have the same 14 18 ; number of elements. 15 ;16 ; @param17 19 ; 18 20 ; @returns … … 24 26 ; IDL> ndays = daysinmonth(2, 2000) 25 27 ; 26 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr)27 ; 2/7/98 28 ; @history 29 ; 2/7/98 Sebastien Masson (smasson\@lodyc.jussieu.fr) 28 30 ; update/review/english/new commons: June 2005 Sebastien Masson. 29 31 ; … … 47 49 IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 48 50 CASE key_caltype OF 49 '360d': if n_elements(month) GT 1 THEN $ 50 return, replicate(30, n_elements(month)) ELSE return, 30 51 '360d':BEGIN 52 if n_elements(month) GT 1 THEN res = replicate(30, n_elements(month)) $ 53 ELSE res = replicate(30, n_elements(time)) 54 IF n_elements(res) EQ 1 THEN res = res[0] 55 return, res 56 END 51 57 'noleap':BEGIN 52 58 days_in_mth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
Note: See TracChangeset
for help on using the changeset viewer.