forked from hummypkg/webif
Fix calculation for midnight today
This commit is contained in:
parent
e595c6b17b
commit
b9bf4fc5d3
@ -306,7 +306,7 @@ proc render_timeline {usedhours} {
|
|||||||
set tomorrow {}
|
set tomorrow {}
|
||||||
|
|
||||||
# Midnight today.
|
# Midnight today.
|
||||||
set day [clock scan "00:00:00" -format "%T"]
|
set day [midnight]
|
||||||
|
|
||||||
set elength [llength $events]
|
set elength [llength $events]
|
||||||
set eindex 0
|
set eindex 0
|
||||||
|
@ -1291,7 +1291,7 @@ proc {rsv allevents} {{xota 0}} {
|
|||||||
lappend events {*}$pending
|
lappend events {*}$pending
|
||||||
}
|
}
|
||||||
|
|
||||||
set today [clock scan 00:00:00 -format "%T"]
|
set today [midnight]
|
||||||
|
|
||||||
set xevents {}
|
set xevents {}
|
||||||
|
|
||||||
|
@ -12,3 +12,8 @@ proc lremove {var val} {
|
|||||||
set v [lsearch -all -inline -not -exact $v $val]
|
set v [lsearch -all -inline -not -exact $v $val]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Returns the epoch time for midnight today
|
||||||
|
proc midnight {} {
|
||||||
|
return $([clock seconds] / 86400 * 86400)
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user