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 Unified Diffs Show Whitespace Changes Patch

Changes to cgi-bin/webcal.py.

63
64
65
66
67
68
69



70

71
72
73
74
75
76
77
def set_today():
    global DAYSECS
    global today, Today

    # Calculate start of today
    t = time.time()
    tm = list(time.localtime(t))



    tm[3] = tm[4] = 0

    today = time.mktime(tm)
    Today = time.localtime(today)
set_today()

# Return for this day of the week, which week it is
# 1..7 -> 1, 8..15 -> 2, etc.
def week_idx(mday):







>
>
>

>







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
def set_today():
    global DAYSECS
    global today, Today

    # Calculate start of today
    t = time.time()
    tm = list(time.localtime(t))
    # Get the native daylight savings for start of this
    #  day; may differ from the current time's, since we
    #  may be asking after 2AM but midnight is before.
    tm[3] = tm[4] = 0
    tm[8] = -1
    today = time.mktime(tm)
    Today = time.localtime(today)
set_today()

# Return for this day of the week, which week it is
# 1..7 -> 1, 8..15 -> 2, etc.
def week_idx(mday):