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

Greg Huber edited comment on WW-5175 at 5/20/22 10:13 AM:
----------------------------------------------------------

We now have to deal with different formats between jdk <=8 and 8+, down to 
Djava.locale.providers={*}COMPAT{*},CLDR.
{code:java}
 // "en_GB", "GB"
 DateTimeFormatter formatter  = DateTimeFormatter.ofPattern("hh:mm a EEEE MMMM 
dd, yyyy",  new Locale("en-GB", "GB"));
 // 2020-03-20T00:00:00.000000 
 LocalDateTime d = LocalDateTime.of(2020, 3, 20, 0, 0);       
 System.out.println(d.format(formatter));
{code}
12:00 AM Fri Mar 20, 2020

if I add COMPAT first
12:00 AM Friday March 20, 2020

Whilst for jdk 8 :
12:00 AM Friday March 20, 2020

Is there an example of struts.date.format in us anywhere?

On my crud screens I would have a hidden field with the date and a formatted 
one for display

<input name="bean.created" type="hidden" value="2022-05-20T10:38:11.285119">

<s:date name="bean.created" format="hh:mm a EEEE MMMM dd, yyyy" />
10:38 AM Friday May 20, 2022

I would use a date picker if I was maintaining a date rather than and input of 
"10:38 AM Friday May 20, 2022".

Maybe I have miss understood the use of struts.date.format?


was (Author: gregh99):
We now have to deal with different formats between jdk <=8 and 8+, down to 
Djava.locale.providers={*}COMPAT{*},CLDR.
{code:java}
 // "en_GB", "GB"
 DateTimeFormatter formatter  = DateTimeFormatter.ofPattern("hh:mm a EEEE MMMM 
dd, yyyy",  new Locale("en-gb", "gb"));
 // 2020-03-20T00:00:00.000000 
 LocalDateTime d = LocalDateTime.of(2020, 3, 20, 0, 0);       
 System.out.println(d.format(formatter));
{code}
12:00 AM Fri Mar 20, 2020

if I add COMPAT first
12:00 AM Friday March 20, 2020

Whilst for jdk 8 :
12:00 AM Friday March 20, 2020

Is there an example of struts.date.format in us anywhere?

On my crud screens I would have a hidden field with the date and a formatted 
one for display

<input name="bean.created" type="hidden" value="2022-05-20T10:38:11.285119">

<s:date name="bean.created" format="hh:mm a EEEE MMMM dd, yyyy" />
10:38 AM Friday May 20, 2022

I would use a date picker if I was maintaining a date rather than and input of 
"10:38 AM Friday May 20, 2022".

Maybe I have miss understood the use of struts.date.format?

> Add basic LocalDateTime support
> -------------------------------
>
>                 Key: WW-5175
>                 URL: https://issues.apache.org/jira/browse/WW-5175
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 2.5.29
>            Reporter: Greg Huber
>            Priority: Minor
>             Fix For: 2.6
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Add basic LocalDateTime support ie for the LocalDateTime.now().



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to