File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 632632
633633function Calendar :set_time ()
634634 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
636638 -- self:rerender_time()
637639 self :set_sel_hour ()
638640 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()
983983 })
984984end
985985
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+
986994--- @return OrgDate
987995function OrgDate :apply_repeater ()
988996 local repeater = self :get_repeater ()
You can’t perform that action at this time.
0 commit comments