Skip to content

Commit

Permalink
fix(tempus): paste correct weekday from calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
jqfeld authored and vhyrro committed May 17, 2023
1 parent 1371d1e commit ba54231
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/neorg/modules/core/tempus/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,11 @@ module.public = {
end

return module.private.tostringable_date({
-- os.date("*t") returns wday with Sunday as 1, needs to be
-- converted to Monday as 1
weekday = osdate.wday and {
number = osdate.wday,
name = neorg.lib.title(weekdays[osdate.wday]),
number = osdate.wday == 1 and 7 or osdate.wday-1,
name = neorg.lib.title(weekdays[osdate.wday == 1 and 7 or osdate.wday-1]),
} or nil,
day = osdate.day,
month = osdate.month and {
Expand Down

0 comments on commit ba54231

Please sign in to comment.