webcalendar

Check-in [281fe22e49]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:281fe22e49423dc21dc7dd0ea91f5fee4a3917f160beff39c95d12e65c5b4d4e
User & Date: ajv-899-334-8894@vsta.org 2017-08-05 16:09:25
Context
2017-08-05
16:10
Fiddle with import of calendar events and when they should be treated as untimed rather than timed with 24 hour duration check-in: b3bc3cc813 user: ajv-899-334-8894@vsta.org tags: master, trunk
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to cgi-bin/webcal.py.

235
236
237
238
239
240
241
242





243
244
245
246
247
248
249
250
251
...
416
417
418
419
420
421
422









423
424
425
426
427
428
429
430
	# Repetition-specific reason
	return self._applies(target)

# Daily repeat
class RepeatDaily(Repeat):

    def _applies(self, target):






	# This day or one within the counted range?
	days = int((time.mktime(target) - self.base) / DAYSECS)
	if self.intvl:
	    if (days % self.intvl):
		return False
	    days /= self.intvl
	if not self.count:
	    return True
	return (days < self.count)
................................................................................
    # Repetition?
    rep = as_rep(tmstart, tup)

    # Represent the Event
    ev = Event(int(tup[WE_ID]), tup[WE_NAME], tmstart, dur, rep)

    # Note if it was an untimed Event









    ev.untimed = ((tup[WE_WHEN+1] < 0) or (ev.dur == 0))

    return ev

def load_cal(calname, filter):

    c = db.cursor()
    c.execute("""select we.* from








>
>
>
>
>

|







 







>
>
>
>
>
>
>
>
>
|







235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
...
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
	# Repetition-specific reason
	return self._applies(target)

# Daily repeat
class RepeatDaily(Repeat):

    def _applies(self, target):

	# We need to talk about this event AT THIS HOUR
	#  of the target day.
	ttm = list(target)
	ttm[3] = self.basetm.tm_hour

	# This day or one within the counted range?
	days = int((time.mktime(ttm) - self.base) / DAYSECS)
	if self.intvl:
	    if (days % self.intvl):
		return False
	    days /= self.intvl
	if not self.count:
	    return True
	return (days < self.count)
................................................................................
    # Repetition?
    rep = as_rep(tmstart, tup)

    # Represent the Event
    ev = Event(int(tup[WE_ID]), tup[WE_NAME], tmstart, dur, rep)

    # Note if it was an untimed Event
    if ev.dur == 0:
	# A zero-length event at a sepcific time is still
	#  considered timed, albeit with an indefinite
	#  finish
	if ev.begin.tm_hour or ev.begin.tm_min:
	    ev.untimed = False
	else:
	    ev.untimed = True
    else:
	ev.untimed = (tup[WE_WHEN+1] < 0)

    return ev

def load_cal(calname, filter):

    c = db.cursor()
    c.execute("""select we.* from