webcalendar

Check-in [818ac02765]
Login

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

Overview
Comment:Add duration
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:818ac027656e0bf38a18c65929a1f0fa9d6df75b158a91e45539dda6a40d59db
User & Date: ajv-899-334-8894@vsta.org 2018-02-05 17:01:46
Context
2018-03-29
04:19
Make it easier to view another day check-in: 564bb5cc45 user: ajv-899-334-8894@vsta.org tags: master, trunk
2018-02-05
17:01
Add duration check-in: 818ac02765 user: ajv-899-334-8894@vsta.org tags: master, trunk
2018-01-12
00:03
Get running on modern PHP check-in: f3f78547ec user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to cgi-bin/ttoday.py.

    41     41       evs = sorted(webcal.load_user(uname, filter_target),
    42     42   	cmp=lambda ev1,ev2: cmp_time(ev1.begin, ev2.begin))
    43     43   
    44     44       for ev in evs:
    45     45   	if ev.untimed:
    46     46   	    w("      %s\n" % (ev.name,))
    47     47   	    continue
    48         -	w("%s " % (time.strftime("%H:%M", ev.begin),))
           48  +	w("%s-%s " % (
           49  +	    time.strftime("%H:%M", ev.begin),
           50  +	    time.strftime("%H:%M",
           51  +	     time.localtime(time.mktime(ev.begin) + ev.dur*60))))
    49     52   	if ev.uname != uname:
    50     53   	    w("%8s " % (ev.uname,))
    51     54   	else:
    52     55   	    w("%8s " % (" ",))
    53     56   	w("%s\n" % (ev.name,))
    54     57   
    55     58   if __name__ == "__main__":
    56     59       init_cli()
    57     60       run()
    58     61       sys.exit(0)