home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0975.lha / PCal / calendar.dat next >
Text File  |  1994-02-14  |  12KB  |  312 lines

  1. # Sample date file for Pcal: this should be called .calendar for Un*x,
  2. # CALENDAR.DAT for VMS, and should live in the user's home directory.
  3. #
  4. # Date file syntax:
  5. #
  6. #    The following rules describe the syntax of date file entries:
  7. #
  8. #      year <year>
  9. #
  10. #      opt <options>
  11. #
  12. #      note{/<number>} <month_spec> <text>
  13. #      note{/<number>} <month> <text>
  14. #
  15. #      if -A flag (American date formats) specified:
  16. #        <month_name> <day>{*} {<text>}
  17. #        <month><sep><day>{<sep><year>}{*} {<text>}
  18. #
  19. #      if -E flag (European date formats) specified:
  20. #        <day> <month_name>{*} {<text>}
  21. #        <day><sep><month>{<sep><year>}{*} {<text>}
  22. #
  23. #      <ordinal> <day_name> in <month_spec>{*} {<text>}
  24. #      <day_name> <prep> <date_spec>
  25. #
  26. #    where
  27. #
  28. #      {x}          means x is optional
  29. #
  30. #      <date_spec> := any of the above date specs (not year, note, or opt)
  31. #      <month_name> := first 3+ characters of name of month, or "all"
  32. #      <month_spec> := <month_name>, or "year"
  33. #      <day_name> := first 3+ characters of name of weekday, "day",
  34. #            "weekday", "workday", "holiday", "nonweekday",
  35. #            "nonworkday", "nonholiday", "new_moon",
  36. #            "first_quarter", "full_moon", or "last_quarter"
  37. #      <ordinal> := ordinal number ("1st", "2nd", etc.), "first" .. "fifth",
  38. #            "last", "even", "odd", or "all"
  39. #      <prep> := "before", "preceding", "after", "following", "nearest",
  40. #            "on_or_before", or "on_or_after"
  41. #      <sep> := one or more non-numeric, non-space, non-'*' characters
  42. #      <month>, <day>, <year> are the numeric forms
  43. #
  44. #      <options> := any command-line option except -[cefhuvDU]
  45. #
  46. #    Comments start with '#' and run through end-of-line.
  47. #
  48. #    Holidays may be flagged by specifying '*' as the last character of
  49. #    the date field(s), e.g. "10/12* Columbus Day", "July 4* Independence
  50. #    Day", etc.  Any dates flagged as holidays will be printed in gray, and
  51. #    any associated text will appear adjacent to the date.
  52. #
  53. #    Note that the numeric date formats (mm/dd{/yy}, dd.mm{.yy}) support
  54. #    an optional year, which will become the subsequent default year.  The
  55. #    alphabetic date formats (month dd, dd month) do not support a year
  56. #    field; the "year yy" command is provided to reset the default year.
  57. #
  58. #    "Floating" days may be specified in the date file as "first Mon in 
  59. #    Sep", "last Mon in May", "4th Thu in Nov", etc.; any word may be
  60. #    used in place of "in".  "Relative floating" days (e.g. "Fri after 4th 
  61. #    Thu in Nov") are also accepted; they may span month/year bounds.
  62. #    Pcal also accepts date specs such as "all Friday{s} in October", "last
  63. #    Thursday in all", etc., and produces the expected results; "each" and
  64. #    "every" are accepted as synonyms for "all".  Negative ordinals are
  65. #    allowed; "-2nd" means "next to last".
  66. #
  67. #    The words "day", "weekday", "workday", and "holiday" may be used as
  68. #    wildcards: "day" matches any day, "weekday" matches any day normally
  69. #    printed in black, "workday" matches any day normally printed in black
  70. #    and not explicitly flagged as a holiday, and "holiday" matches any
  71. #    day explicitly flagged as a holiday.  "Nonweekday", "nonworkday",
  72. #    and "nonholiday" are also supported and have the obvious meanings.
  73. #    Moon phases may also appear as wildcards; "nm" is accepted as a
  74. #    synonym for "new_moon", "1q" and "fq" for "first_quarter", "fm" for
  75. #    "full_moon", and "3q", "lq", and "third_quarter" for "last_quarter". 
  76. #
  77. #    "Odd" and "even" do not refer to the actual date; instead, "odd"
  78. #    means "alternate, starting with the first"; "even" means "alternate,
  79. #    starting with the second".  Thus, "odd Fridays in March" refers to
  80. #    the first, third, and (if present) fifth Fridays in March - not to
  81. #    those Fridays falling on odd dates.
  82. #
  83. #    "All" refers to each individual month; "year" refers to the year
  84. #    as an entity.  Thus "odd Fridays in all" refers to the first/third/
  85. #    fifth Friday of each month, while "odd Fridays in year" refers to
  86. #    the first Friday of January and every other Friday thereafter.
  87. #
  88. #    Additional notes may be propagated to an empty calendar box by the
  89. #    inclusion of one or more lines of the form "note{/<number>} <month>
  90. #    <text>", where <month> may be numeric or alphabetic; "note{/<number>}
  91. #    all <text>" propagates <text> to each month in the current year.
  92. #    <number> is an optional positive or negative number specifying the
  93. #    empty box where the associated text is to be placed: if positive,
  94. #    Pcal counts forward from the first empty box; if negative, Pcal counts
  95. #    backward from the last empty box.  Thus, "note/1 ..." places the
  96. #    associated text in the first empty box, and "note/-3 ..." in the
  97. #    third-to-last; the default is -1 (last empty box).  (Note that if the
  98. #    -S option is used, it must be specified either on the command line or
  99. #    prior to any "note" lines in the date file.)
  100. #
  101. #    Pcal also allows format specifiers in the text (and foot strings -
  102. #    cf. the -L, -C, -R, and -N options); each will be replaced by its
  103. #    equivalent string as outlined in the table below.  (Most of these are
  104. #    derived from the strftime() function; %[louwMD0+-] are Pcal-specific.)
  105. #
  106. #        %a : abbreviated weekday
  107. #        %A : full weekday
  108. #        %b : abbreviated month name
  109. #        %B : full month name
  110. #        %d : day of month (1-31)
  111. #        %j : day of year (1-366)
  112. #        %l : days left in year (0-365)
  113. #        %m : month (1-12)
  114. #        %u : week number (1-54)
  115. #        %U : week number (0-53)
  116. #        %w : week number (1-54)
  117. #        %W : week number (0-53)
  118. #        %y : year w/o century (00-99)
  119. #        %Y : year w/century
  120. #        %% : '%' character
  121. #
  122. #        %o : print number as ordinal
  123. #        %0 : print number with leading zeroes
  124. #        %+ : use following month or year
  125. #        %- : use previous month or year
  126. #        %{+N}[DWMY] : adjust date by +N days/weeks/months/years
  127. #        %{-N}[DWMY] : adjust date by -N days/weeks/months/years
  128. #
  129. #    %u considers the week containing 1/1 as week 1 and the following
  130. #    logical Sunday (the first day of the week as printed; cf. the -F
  131. #    flag) as the start of week 2; %U considers the first logical Sunday
  132. #    as the first day of week 1.  %w and %W behave like %u and %U
  133. #    respectively, but use the first logical Monday instead.  (Note that
  134. #    %w has a different meaning to strftime().)
  135. #
  136. #    %o prints a number as an ordinal, with the appropriate suffix ("st",
  137. #    "nd", "rd", or "th" in English) appended; for example, "%od" prints
  138. #    the day of the month as "1st", "2nd", "3rd", etc.
  139. #
  140. #    Unlike strftime(), Pcal's default is to print numbers (except %y)
  141. #    without leading zeroes.  If leading zeroes are desired, the '0'
  142. #    prefix may be used; for example, "%0j" prints the day of year as
  143. #    001-365.
  144. #
  145. #    %+ and %- direct Pcal to substitute the following/previous month/year
  146. #    in the following [bBmyY] specifier; for example, "%+B" prints the
  147. #    name of the next month.
  148. #
  149. #    %{[+-]N}[DWMY] do not print anything, but instead adjust the
  150. #    working date by +-N days (D), weeks (W), months (M), or years (Y);
  151. #    subsequent format specifiers use the adjusted date instead of the
  152. #    current date.  For example, "%+1M %B %Y" adjusts the date forward by
  153. #    one month and then prints the resulting month and year ("January
  154. #    1991" in December, 1990); "%-2W %b %d" adjusts the date backward
  155. #    by two weeks and prints the resulting month and day ("Jul 26" on
  156. #    August 9).
  157. #
  158. #    Such date adjustments are normally cumulative; for example,
  159. #    "%+1Y%-1D" adjusts the date forward by one year and then backward
  160. #    by one day.  If %D or %M is specified alone (or if N is zero), Pcal
  161. #    restores the original date.  (Note that %M has a different meaning
  162. #    to strftime().)
  163. #
  164. #    The "Notes" box uses the first of the current month as the default
  165. #    date.  All foot strings use the first of the current month in single-
  166. #    month mode and the first of the starting month in whole-year mode.
  167. #
  168. #    Simple cpp-like functionality is provided.  The date file may include
  169. #    the following commands, which work like their cpp counterparts:
  170. #
  171. #        define <sym>
  172. #        undef <sym>
  173. #
  174. #        if{{n}def} <expr>
  175. #           ...
  176. #        { elif <expr>
  177. #           ... }*
  178. #        { else
  179. #           ... }
  180. #        endif
  181. #
  182. #        include <file>
  183. #
  184. #    Note that these do not start with '#', which is reserved as a comment
  185. #    character.
  186. #
  187. #    <sym> is a symbol name consisting of a letter followed by zero or
  188. #    more letters, digits, or underscores ('_').  Symbol names are always
  189. #    treated in a case-insensitive manner.
  190. #
  191. #    <expr> is an expression consisting of symbol names joined by the logical
  192. #    operators (in order of precedence, high to low) '!' (unary negate), '&'
  193. #    (and), '^' (exclusive or), and '|' (inclusive or).  '&&' and '||' are
  194. #    accepted as synonyms for '&' and '|' respectively; the order of
  195. #    evaluation may be altered by the use of parentheses.  A symbol whose
  196. #    name is currently defined evaluates to TRUE; one whose name is not
  197. #    currently defined evaluates to FALSE.  Thus "ifdef A | B | C" is TRUE
  198. #    if any of the symbols A, B, and C is currently defined, and
  199. #    "ifdef A & B & C" is TRUE if all of them are.
  200. #
  201. #    "ifndef A | B | C" is equivalent to "ifdef !(A | B | C)" (or, using
  202. #    DeMorgan's Law, "ifdef !A & !B & !C") - in other words, TRUE if none of
  203. #    the symbols A, B, and C is currently defined.
  204. #
  205. #    "if" is accepted as a synonym for "ifdef".
  206. #
  207. #    "elif A" is TRUE if A is defined.  Multiple "elif" clauses may appear;
  208. #    at most one "if{{n}def}", "elif", or "else" clause in a given block
  209. #    will be processed.
  210. #
  211. #    "define" alone deletes all the current definitions; "if{def}" alone is
  212. #    always false; "ifndef" alone is always true.
  213. #
  214. #    The file name in the "include" directive may optionally be surrounded
  215. #    by "" or <>; in any case, path names are taken to be relative to
  216. #    the location of the file containing the "include" directive.  If the
  217. #    string "%y" appears in the file name, it is replaced by the last two
  218. #    digits of the current year.
  219. #
  220. #    The "-w" flag defines the symbol "whole_year", which may be tested
  221. #    in the same manner as any user-defined symbol.
  222.  
  223.  
  224. # "opt" lines to override program defaults
  225.  
  226. opt -d Helvetica-Bold -t Helvetica-Bold -n Helvetica/8    # override default fonts
  227. opt -s 0.6/0.97        # override default date/fill box shading
  228. opt -M             # moon icons on all days
  229. ifndef whole_year
  230. opt -O            # print outlined characters if "-w" NOT specified
  231. endif
  232.  
  233. year 1994        # set year explicitly
  234.  
  235. # note to be propagated to "Notes" box (-2 = bottom center) for all months
  236.  
  237. opt -N Meetings:        # alternate header for notes box
  238. note/-2 all            Engineering staff meeting every Tuesday, 1:30 PM
  239.  
  240. # examples of format specifiers
  241.  
  242. all Monday in all        Fiscal week %W.%y    # e.g. 26.91
  243. last workday in all        %B status meeting    # substitute month name
  244. 2nd workday in all        %-B status report due    # use previous month
  245.  
  246. # some sample holidays (flagged by '*') and other days of note
  247.  
  248. 1/1*                New Year's Day
  249.  
  250. # if "AZ" or "MT" defined, holiday definition will be skipped
  251. ifndef AZ || NH || MT
  252. 3rd Monday in Jan*        Martin Luther King Day (except AZ, NH, MT)
  253. endif
  254.  
  255. 3rd Monday in Feb        Presidents' Day
  256. Feb 14                Valentine's Day
  257.  
  258. # any Pcal users in Alaska?
  259. ifdef AK
  260. first Sat in March        Iditarod starts
  261. endif
  262.  
  263. 3/17                St. Patrick's Day
  264.  
  265. # another local holiday - included only if "MA" or "ME" defined
  266. ifdef MA || ME
  267. 3rd Monday in Apr        Patriots' Day (MA, ME)
  268. endif
  269.  
  270. last Monday in May*        Memorial Day
  271.  
  272. 6/14                Flag Day
  273.  
  274. 7/4*                Independence Day
  275.  
  276. 1st Monday in Sep*        Labor Day
  277.  
  278. second Monday in Oct        Columbus Day (observed)
  279. 10/31                Halloween
  280.  
  281. Tue after first Mon in Nov    Election Day
  282. second Mon in Nov        Veterans' Day # (observed)
  283. fourth Thu in Nov*        Thanksgiving
  284. day after fourth Thu in Nov*
  285.  
  286. 12/24*                Christmas Eve
  287. 12/25*                Christmas
  288. last day in Dec*        New Year's Eve
  289.  
  290. # if the symbol "paydays" has been defined, print text on alternate
  291. # Fridays (starting with the first Friday of the year)
  292. ifdef paydays
  293. odd Fridays in year        Pay Day
  294. endif
  295.  
  296. 2nd full_moon in all        Blue Moon
  297.  
  298. # if the symbol "meetings" has been defined, print text on the next-to-last
  299. # Monday of each month
  300. ifdef meetings
  301. -2nd Monday in all        Monthly staff meeting
  302. endif
  303.  
  304. # if the symbol "whole_year" has been defined (either explicitly or implicitly
  305. # via "-w"), print a center foot string containing the first and last dates of
  306. # the year
  307. ifdef whole_year
  308. opt -C "Fiscal year %B %d, %Y - %+1Y%-1D%B %d, %Y"
  309. endif
  310.  
  311. 1/1/95*                New Year's Day        # reset year implicitly
  312.