-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathReadme.tid
139 lines (102 loc) · 3.72 KB
/
Readme.tid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
month: 1
title: $:/plugins/OokTech/Calendar/readme
year: 1990
To see this plugin in use you can see it on my page [[here|http://ooktech.com/jed/externalbrain/#Calendar%20Archives]]
This plugin has:
*The calendar-month widget
*Default css class for the calendar month widget
*Default macro for calendar days
*This readme
!The calendar-month widget
Usage: `<$calendar-month year=YYYY month=MM day_macro=someMacro class=someCSSClass/>`
Content of the `<$calendar-month>` widget is ignored.
|!Attribute |!Description |
|year |The year that the month displayed is from. It must be in 4 digit YYYY format and has no default value. |
|month |The month to display. See list below for valid month values. month has no default value. |
|day_macro |(optional) The macro that defines the content of each calendar day. It is passed the parameters `day`, `month`, `year` and `dayOfTheWeek` with the correct values for the current day of the month. Defaluts to `CalendarListDailyThings` defined in [[Calendar Default Macros|$:/plugins/OokTech/Calendar/Calendar Default Macros]] |
|weekstart |Set equal to Sunday or Monday to specify the first day of the week, defaults to Monday. |
|class |(optional) A css class to use. Defaults to the class `calendar-table` defined in [[Calendar Table Style|$:/plugins/OokTech/Calendar/Calendar Table Style]] |
!The default ~CalendarListDailyThings macro
This macro lists any tiddlers that have fields called `day`, `month` and `year` in the matching calendar day. If you click on a cell than a tiddler with a title in the form of (day)-(month)-(year) is opened.
!Making custom day macros
The macro is put inside each day of the month and passed the appropriate values for day, month, year and dayOfTheWeek.
*`day` is the day of the month and will be in the range [1,31].
*`month` is given as a number in the range [1,12] where 1 is January and 12 is December.
*`year` is the 4 digit year value and is the same as the value passed to the widget
*`dayOfTheWeek` is a number representing the day of the week, if you have the week starting on Monday than Monday is 0 and Sunday is 6, if you have the week start on Sunday than Sunday is 0 and Saturday is 6
One of the simplest macros would be:
```
\define SimpleCalendarDayMacro(day month year dayOfWeek)
$day$
\end
```
which just displays the current date in each day on the calendar.
When you make a macro for the calendar remember that you either need to put it in a tiddler tagged with `$:/tags/Macros` or you need to put the macro in the same tiddler where you use the calendar widget.
!Month values
This is a complete list of the month values the widget understands, if you want some other format added leave a message at [[my site|http://www.inmysocks.tiddlyspot.com]].:
1
01
Jan
Jan.
January
2
02
Feb
Feb.
February
3
03
Mar
Mar.
March
4
04
Apr
Apr.
April
5
05
May
6
06
Jun
Jun.
June
7
07
Jul
Jul.
July
8
08
Aug
Aug.
August
9
09
Sep
Sep.
Sept
Sept.
September
10
Oct
Oct.
October
11
Nov
Nov.
November
12
Dec
Dec.
December
!Example:
```
Select year: <$select field='year'><$list filter='1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000'><option><<currentTiddler>></option></$list></$select>
Select month: <$select field='month'><$list filter='1 2 3 4 5 6 7 8 9 10 11 12'><option><<currentTiddler>></option></$list></$select>
<$calendar-month year={{!!year}} month={{!!month}} day_macro=CalendarListDailyThings/>
```
Select year: <$select field='year'><$list filter='1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000'><option><<currentTiddler>></option></$list></$select>
Select month: <$select field='month'><$list filter='1 2 3 4 5 6 7 8 9 10 11 12'><option><<currentTiddler>></option></$list></$select>
<$calendar-month year={{!!year}} month={{!!month}} day_macro=CalendarListDailyThings/>