[ 
https://issues.apache.org/jira/browse/JOHNZON-399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17751394#comment-17751394
 ] 

Romain Manni-Bucau commented on JOHNZON-399:
--------------------------------------------

Personally i used a custom deserializer for this case but i tend to stop that 
hack to assume there is no single contract and use a string with doc instead to 
show it is not bound to a clear type. On a design/api aspect it is cleaner 
imho. That said technically a deserializer works.

 

Side note: angular can sanitize the date before sending it, this is what must 
be done when using an api (ie not internal endpoint) since often format is 
enforced, even just dropping ns is a common pattern.

> JsonbLocalDateConverter should also read javascript date format
> ---------------------------------------------------------------
>
>                 Key: JOHNZON-399
>                 URL: https://issues.apache.org/jira/browse/JOHNZON-399
>             Project: Johnzon
>          Issue Type: Improvement
>          Components: JSON-B
>    Affects Versions: 1.2.21
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>            Priority: Major
>             Fix For: 2.0.0, 1.2.22
>
>
> Javascript's date is very similar to java.util.Date - it does not only 
> contain the date but also a time portion. The format is 
> {code:java}
> YYYY-MM-DDTHH:mm:ss.sssZ{code}
> When using e.g. a datepicker and send it via JSON in JavaScript the time 
> portion is set to 00:00:00.000. But this leads to a date format exception in 
> our {code}JsonbLocalDateConverter{code}.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to