]> diplodocus.org Git - nmh/blob - etc/mhical.12hour
fgets() reserves space for the NUL itself.
[nmh] / etc / mhical.12hour
1 %; mhical.12hour
2 %; Form file for mhical that directs it to use 12-hour instead of 24-hour
3 %; time format.
4 %;
5 %; See mhical.24hour for list of supported components.
6 %;
7 %; Here's what it does to the %{dtstart} special component:
8 %;
9 %; 1) Enable bold, and if the terminal supports color, green attributes.
10 %; 2) If the time zone is explicit, coerce the date to the local time zone;
11 %; otherwise, assume that it's a floating time.
12 %; 3) Output the date in "ddd DD MM YYYY" format.
13 %; 4) Convert hours from 24- to 12-hour clock and output them as soon as
14 %; they are calculated. Store AM or PM in the str register.
15 %; 5) Output :minutes.
16 %; 6) Output AM or PM.
17 %; 7) If the time zone is explicit, output it.
18 %; 8) Reset all terminal attributes.
19 %; The timezone is not output for the dtend component because it is
20 %; almost always (except across a daylight saving time transition)
21 %; the same as for the dtstart component.
22 %;
23 %<(nonnull{method})Method: %(putstr{method})\n%>\
24 %<(nonnull{organizer})Organizer: %(putstr{organizer})\n%>\
25 %<(nonnull{summary})Summary: %(putstr{summary})\n%>\
26 %<(nonnull{description})Description: %(putstr{description})\n%>\
27 %<(nonnull{location})Location: %(putstr{location})\n%>\
28 %<(nonnull{dtstart})At: \
29 %<(hascolor)%(zputlit(fgcolor green))%>%(zputlit(bold))\
30 %(void(szone{dtstart}))%<(gt 0)%(date2local{dtstart})%>\
31 %(day{dtstart}), %02(mday{dtstart}) %(month{dtstart}) %(year{dtstart}) \
32 %(void(hour{dtstart}))%<(eq 0)%(num 12)%(void(lit AM))\
33 %?(eq 12)%(num 12)%(void(lit PM))\
34 %?(gt 12)%2(modulo 12)%(void(lit PM))\
35 %|%2(putnumf)%(void(lit AM))%>\
36 :%02(min{dtstart}) \
37 %(putlit)%; AM or PM
38 %(void(szone{dtstart}))%<(gt 0) %(tzone{dtstart})%>\
39 %(zputlit(resetterm))\n%>\
40 %<(nonnull{dtstart})To: \
41 %(void(szone{dtend}))%<(gt 0)%(date2local{dtend})%>\
42 %(day{dtend}), %02(mday{dtend}) %(month{dtend}) %(year{dtend}) \
43 %(void(hour{dtend}))%<(eq 0)%(num 12)%(void(lit AM))\
44 %?(eq 12)%(num 12)%(void(lit PM))\
45 %?(gt 12)%2(modulo 12)%(void(lit PM))\
46 %|%2(putnumf)%(void(lit AM))%>\
47 :%02(min{dtend}) \
48 %(putlit)\n%>%; AM or PM
49 %<(nonnull{attendees})%(putstr{attendees})\n%>\