File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 632
632
633
633
function Calendar :set_time ()
634
634
self .date = self :get_selected_date ()
635
- self .date = self .date :set ({ date_only = false })
635
+ if self .date .date_only then
636
+ self .date = self .date :set ({ date_only = false }):set_current_time ()
637
+ end
636
638
-- self:rerender_time()
637
639
self :set_sel_hour ()
638
640
self :render () -- because we want to highlight the currently selected date, we have to render everything
Original file line number Diff line number Diff line change @@ -983,6 +983,14 @@ function OrgDate:set_todays_date()
983
983
})
984
984
end
985
985
986
+ function OrgDate :set_current_time ()
987
+ local time = os_date (os.time ())
988
+ return self :set ({
989
+ hour = tonumber (time .hour ) or 0 ,
990
+ min = tonumber (time .min ) or 0 ,
991
+ })
992
+ end
993
+
986
994
--- @return OrgDate
987
995
function OrgDate :apply_repeater ()
988
996
local repeater = self :get_repeater ()
You can’t perform that action at this time.
0 commit comments