Skip to content

Commit

Permalink
fixup! refactor(date): improve type hints
Browse files Browse the repository at this point in the history
  • Loading branch information
seflue committed Jun 10, 2024
1 parent acf9c4f commit 8a672d5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lua/orgmode/objects/date.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ local time_format = '%H:%M'

---@alias OrgDateSpan 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year'

---@class OsTime
---@alias OsTime number

---@class OsDate
---@field day number?
---@field wday string?
---@field month number?
---@field year number?
---@field hour number?
Expand Down Expand Up @@ -59,9 +60,6 @@ local Date = {
end,
}

---@alias DateTbl { year: number, month: number, day: number, hour: number, min: number }
---@alias DateTblWithSec { year: number, month: number, day: number, hour: number, min: number, sec: number }

---@param source table
---@param target? table
---@param include_sec? boolean
Expand Down Expand Up @@ -535,7 +533,7 @@ end
function Date:get_weekday()
---@type table
---@diagnostic disable-next-line: assign-type-mismatch
local date = os.date('*t', self.timestamp)
local date = os_date(self.timestamp)
return date.wday
end

Expand Down

0 comments on commit 8a672d5

Please sign in to comment.