From f1ba9dac7e941d04a888a73130c409de9d52ba3b Mon Sep 17 00:00:00 2001 From: Simon Mika Date: Tue, 3 Dec 2024 16:37:55 +0100 Subject: [PATCH 1/2] Added DateTime converter as that is very commonly used. --- Property/Converter/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Property/Converter/index.ts b/Property/Converter/index.ts index 83b4f74..07ae5f0 100644 --- a/Property/Converter/index.ts +++ b/Property/Converter/index.ts @@ -1,3 +1,4 @@ +import { isoly } from "isoly" import { Payload } from "../../Payload" import { Configuration as ConverterConfiguration } from "./Configuration" @@ -33,4 +34,8 @@ export class Converter = Record isoly.DateTime.epoch(value, "seconds"), + decode: (value: number) => isoly.DateTime.create(value), + } } From b88dd9e54a3430b742a2dba1a8b421b9c7cd3480 Mon Sep 17 00:00:00 2001 From: Simon Mika Date: Tue, 3 Dec 2024 16:40:58 +0100 Subject: [PATCH 2/2] Fixed missing type. --- Property/Converter/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Property/Converter/index.ts b/Property/Converter/index.ts index 07ae5f0..6d8efd7 100644 --- a/Property/Converter/index.ts +++ b/Property/Converter/index.ts @@ -35,7 +35,7 @@ export class Converter = Record isoly.DateTime.epoch(value, "seconds"), + encode: (value: isoly.DateTime) => isoly.DateTime.epoch(value, "seconds"), decode: (value: number) => isoly.DateTime.create(value), } }