morphir-elm
morphir-elm copied to clipboard
Add LocalTime support
Is your feature request related to a problem? Please describe. It's time... We need LocalTime in the SDK.
Describe the solution you'd like Support for basic time and time math. Keep it simple and local without time zones.
Describe alternatives you've considered None
Additional context We're going to need Timestamp soon...
Hi @stephengoldbaum I would like to have a go at this issue. I need a little bit more information, is it the same idea behind the LocalDate
in SDK?
Hi @Pancakem , that is great to hear. Yes, it is essentially the same approach as LocalDate in that we need the structure, basic time math, and comparison. So it can totally be modeled after LocalDate. Implementing means three tasks:
- Define LocalTime in the Morphir.IR.SDK module - This defines LocalTime as a concept in the SDK of the IR. The SDK defines concepts that are to be implemented in the various backend target languages. So add LocalTime.elm into the src/Morphir/IR/SDK folder.
- Define how LocalTime will be handled in Elm - This is the implementation for Elm as a backend target language. This means finding the most appropriate Elm library for working with Time and mapping the SDK functions to use that. This is done by adding LocalTime to the Morphir.SDK module (src/Morphir/SDK/LocalTime.elm).
- Write tests - In the tests folder. LocalDate is a good example to follow.
That would be an excellent start. Once that's done we'll want to add the SDK implementation for Scala (in the morphir-jvm project), which you can optionally choose to do if you want.
Thank you and looking forward to your contribution!
Sweet! On it.