Functions | |
otherwise | print_usage () |
c (weekday(dayone)-1+[1:ndays]) | |
if (nargout > 0) varargout | |
if (!isempty(d)&&d >=1 &&d<=ndays) pos | |
while (str(idx)==" ")++idx | |
endwhile | str (--idx) |
puts (strftime(" %b %Y\n", s)) | |
puts (" S M Tu W Th F S\n") | |
puts (str) | |
endif endfunction | !assert ((calendar(2000, 2))'(2:31),[0:29]) |
!assert ((calendar(1957, 10))'(2:33),[0:31]) | |
!demo | !calendar ()%!demo%!calendar(1957 |
Variables | |
function | varargout |
y = v(1) | |
m = v(2) | |
d = v(3) | |
case | v = datevec (varargin{1}) |
endswitch | c = zeros (7, 6) |
dayone = datenum (y, m, 1) | |
ndays = eomday (y, m) | |
else | str = c' sprintf (" %2d %2d %2d %2d %2d %2d %2d\n", c) |
idx = 6 * (pos - 1) + floor (pos / 7) + 1 | |
endif s | year = y - 1900 |
s | mon = m - 1 |
!assert | ( | (calendar(1957, 10))'(2:33) | ) |
endif endfunction !assert | ( | (calendar(2000, 2))'(2:31) | ) |
!demo !calendar | ( | ) |
c | ( | weekday(dayone)-1+ | [1:ndays] | ) |
if | ( | !isempty(d)&&d >=1 &&d<= | ndays | ) |
if | ( | nargout | , | |
0 | ||||
) |
otherwise print_usage | ( | ) |
puts | ( | str | ) |
puts | ( | " S M Tu W Th F S\n" | ) |
puts | ( | strftime(" %b %Y\n", s) | ) |
endwhile str | ( | -- | idx | ) |
while | ( | str(idx) | = =" " |
) |
endswitch c = zeros (7, 6) |
d = v(3) |
dayone = datenum (y, m, 1) |
idx = 6 * (pos - 1) + floor (pos / 7) + 1 |
m = v(2) |
s mon = m - 1 |
ndays = eomday (y, m) |
else str = c' sprintf (" %2d %2d %2d %2d %2d %2d %2d\n", c) |
case v = datevec (varargin{1}) |
case y = v(1) |