summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-09-12 23:31:49 +0200
committerAki <please@ignore.pl>2023-09-12 23:31:49 +0200
commit13a7a72279674c2a2180daa67fede63660218fd9 (patch)
tree0240bcc4191f972eb9813134a2c24bd9c194c34d
parent3840c436be9da689086b1d87247da19b17c1da48 (diff)
downloadactivity-13a7a72279674c2a2180daa67fede63660218fd9.zip
activity-13a7a72279674c2a2180daa67fede63660218fd9.tar.gz
activity-13a7a72279674c2a2180daa67fede63660218fd9.tar.bz2
this_year now returns a number
-rw-r--r--activity/dates.lua2
-rw-r--r--spec/dates_spec.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/activity/dates.lua b/activity/dates.lua
index c863cdb..038ea6b 100644
--- a/activity/dates.lua
+++ b/activity/dates.lua
@@ -10,7 +10,7 @@ end
function dates.this_year ()
- return os.date"%Y"
+ return tonumber(os.date"%Y")
end
diff --git a/spec/dates_spec.lua b/spec/dates_spec.lua
index 6239fdc..1c5382e 100644
--- a/spec/dates_spec.lua
+++ b/spec/dates_spec.lua
@@ -21,7 +21,7 @@ describe("Days in a year", function()
end)
describe("This year is", function()
- local this_year = os.date "%Y" -- Quite useless test
+ local this_year = tonumber(os.date"%Y") -- Quite useless test
it(tostring(this_year), function()
assert.are.equal(this_year, dates.this_year())