webcalendar

Check-in [c847fd4b5f]
Login

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

Overview
Comment:Fix "today" concept so it still works on daylight savings change days
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:c847fd4b5f9bba4124949fd618eff42f2518952f0cdb25a363ed9ae19f9e5965
User & Date: vandys 2019-03-10 20:37:03
Context
2019-04-10
23:56
Replace dead old PHP API Leaf check-in: d701842a8d user: vandys tags: master, trunk
2019-03-10
20:37
Fix "today" concept so it still works on daylight savings change days check-in: c847fd4b5f user: vandys tags: master, trunk
2018-10-23
04:08
Hard to decode the intention, but this *seems* like handling a redundant way to talk about a Sunday? check-in: 1b0e2aef79 user: vandys tags: master, trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to cgi-bin/webcal.py.

    63     63   def set_today():
    64     64       global DAYSECS
    65     65       global today, Today
    66     66   
    67     67       # Calculate start of today
    68     68       t = time.time()
    69     69       tm = list(time.localtime(t))
           70  +    # Get the native daylight savings for start of this
           71  +    #  day; may differ from the current time's, since we
           72  +    #  may be asking after 2AM but midnight is before.
    70     73       tm[3] = tm[4] = 0
           74  +    tm[8] = -1
    71     75       today = time.mktime(tm)
    72     76       Today = time.localtime(today)
    73     77   set_today()
    74     78   
    75     79   # Return for this day of the week, which week it is
    76     80   # 1..7 -> 1, 8..15 -> 2, etc.
    77     81   def week_idx(mday):