Support Nodatime in Property Types

Please consider supporting Nodatime property types. Thanks!



  •[email protected] Czech RepublicMember, Administrator, Kentico Staff admin
    edited May 2017

    Hi Jacob,

    Cool, I wasn't aware of Noda Time until now. I've done a quick scan of an MSDN article about it and it looks good. If it was co-developed by Jon Skeet, it automatically became my favorite .NET library.

    From the quick scan of that article, I've got the main idea of Noda Time: The time offsets of time zones. This is great. But, I was wondering if there were other benefits of Noda Time you could tell us about.

    I'd say that in Kentico Cloud, the 'Date & time' elements store the information without relations to any time zones. Is that correct, @TomasHruby ?

    With that in mind, I'd say the author of a website can set their own base time zone, say UTC (UTC is not being considered as a time zone probably, but you certainly get the gist). Then, using Noda Time (or any other library), the application can compute 'localized' time.

    That being said, it seems to be appropriate to have support for Noda Time in the SDKs, boilerplates and sample apps, rather than in Kentico Cloud itself.

    Do I understand that correctly? If not, just tell me. I really like the idea of having support of time zones.


  •[email protected] Member, Kentico Staff mod
    edited June 2017

    You're absolutely correct in your assumptions, @JanLenoch .

  •[email protected] Eindhoven, NLMember, Administrator, Kentico Staff admin

    Hi @JacobMojiwat ! Thanks for a nice suggestion!

    There is no out of the box deserialization at the moment.
    What you can do is that you can either wrap or extend the (possibly generated) model and add a ZonedDateTime property that would be initialized from the standard DateTime property.

    Anyway, it would be great if the SDK supported any custom type during deserialization.

    @MartinHejtmanek is currently working on a prototype of "value convertors" here: this would solve the issue nicely.

    We'd appreciate if you'd tell us what you think.

  •[email protected] Eindhoven, NLMember, Administrator, Kentico Staff admin

    Good news! It's possible now. In Delivery SDK v4.7, we've added support for "value converters". Also, we've added an example specifically for the ZonedDateTime.


  • jmojiwatjmojiwat Member

    @[email protected] , @[email protected] Sorry for this very late reply. Haven't been following this issue until recently when we had to update our code. A belated thank you very much for building this feature and making it easy for us to integrate. :+1:

  •[email protected] Czech RepublicMember, Administrator, Kentico Staff admin

    Hi @jmojiwat , you're welcome! Feel free to let us know your comments about how it worked for you.

Sign In or Register to comment.