webcalendar

Check-in [d993e79f2f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Another variant of weekly by day; infer day and week index from base time.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:d993e79f2fb772e7983bee848de3adceaa209adbfa6b231591fb4ebdd260fd31
User & Date: ajv-899-334-8894@vsta.org 2017-06-14 14:18:26
Context
2017-08-05
16:09
For day count, be sure to allow for that event's time in the current day. Treat zero duration events with a time as timed. check-in: 281fe22e49 user: ajv-899-334-8894@vsta.org tags: master, trunk
2017-06-14
14:18
Another variant of weekly by day; infer day and week index from base time. check-in: d993e79f2f user: ajv-899-334-8894@vsta.org tags: master, trunk
2017-06-10
17:15
Handle event count on monthly by day. Handle display when there are no timed events. check-in: cb0f89b99e user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to cgi-bin/webcal.py.

21
22
23
24
25
26
27

28
29
30
31
32
33
34
...
281
282
283
284
285
286
287












288
289
290
291
292
293
294
295
296
297
298
WER_CNT = 13	# Count

# Indices in webcal_entry_repeats_not
WEX_WHEN = 1	# Date of exclusion

# Map from abbreviated weekday name to ical standard index
DAYIDX = {"mo": 0, "tu": 1, "we": 2, "th": 3, "fr": 4, "sa": 5, "su": 6}


# Load Webcalendar config into cfg{}
HTBASE = "/webcal/"
CALBASE = "/var/www/vatclip/htdocs" + HTBASE
CFG = CALBASE + "includes/settings.php"
cfg = {}
def load_cfg(fn):
................................................................................
	else:
	    self.days = frozenset([self.basetm.tm_wday])

# Monthly, by day of week
class RepeatMonthlyDay(Repeat):

    def init2(self, rep):












	# "2TU" means 2nd Tuesday of the month
	wday = rep[WER_WDAY].lower()
	dow = wday[-2:]
	assert self.basetm.tm_wday == DAYIDX[dow]
	wday = wday[:-2]
	if wday:
	    self.offset = int(wday)
	else:
	    self.offset = None

    def _applies(self, target):







>







 







>
>
>
>
>
>
>
>
>
>
>
>

<

|







21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
...
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301

302
303
304
305
306
307
308
309
310
WER_CNT = 13	# Count

# Indices in webcal_entry_repeats_not
WEX_WHEN = 1	# Date of exclusion

# Map from abbreviated weekday name to ical standard index
DAYIDX = {"mo": 0, "tu": 1, "we": 2, "th": 3, "fr": 4, "sa": 5, "su": 6}
DAYNAMES = ("mo", "tu", "we", "th", "fr", "sa", "su")

# Load Webcalendar config into cfg{}
HTBASE = "/webcal/"
CALBASE = "/var/www/vatclip/htdocs" + HTBASE
CFG = CALBASE + "includes/settings.php"
cfg = {}
def load_cfg(fn):
................................................................................
	else:
	    self.days = frozenset([self.basetm.tm_wday])

# Monthly, by day of week
class RepeatMonthlyDay(Repeat):

    def init2(self, rep):
	global DAYNAMES
	btm = self.basetm

	# Get weekday specifier.  If it's not there, we have to
	#  go make it up for ourselves.
	wday = rep[WER_WDAY]
	if wday is None:
	    weekidx = week_idx(btm.tm_mday)
	    wday = str(weekidx) + DAYNAMES[btm.tm_wday]
	else:
	    wday = wday.lower()

	# "2TU" means 2nd Tuesday of the month

	dow = wday[-2:]
	assert btm.tm_wday == DAYIDX[dow]
	wday = wday[:-2]
	if wday:
	    self.offset = int(wday)
	else:
	    self.offset = None

    def _applies(self, target):