From f956b07ca0480883c7a050d190b8bc6b1a509d85 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 26 Oct 2021 15:17:49 +0200 Subject: util.dataforms: Turn number values into timestamps for datetime fields Makes it symmetric with parsing. --- spec/util_dataforms_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/util_dataforms_spec.lua b/spec/util_dataforms_spec.lua index a76a9565..16fffb42 100644 --- a/spec/util_dataforms_spec.lua +++ b/spec/util_dataforms_spec.lua @@ -461,7 +461,7 @@ describe("util.dataforms", function () local f = dataforms.new { { name = "when"; type = "text-single"; datatype = "xs:dateTime" } } -- luacheck: ignore 431 it("works", function () - local x = f:form({ when = "2008-08-22T21:09:00Z" }); + local x = f:form({ when = 1219439340 }); assert.equal("2008-08-22T21:09:00Z", x:find("field/value#")) local d, e = f:data(x); assert.is_nil(e); -- cgit v1.2.3