Converters for Date/Time

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Converters for Date/Time

Илья Нарыжный
Hello,

I have some fundamental question about Wicket:)
For users it's convenient when date-time has shown in their timezone.
So most of wicket devs, do that somehow like we did it here:
https://github.com/OrienteerBAP/Orienteer/blob/master/orienteer-core/src/main/java/org/orienteer/core/component/property/date/ODateLabel.java
But question is: does it make sense to put conversion per time-zone
into DateConverter or that might broke something wicket
best-practices?

Thanks,
Ilya
---------------------------------------------
Orienteer(http://orienteer.org) - open source Business Application Platform

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Converters for Date/Time

Sven Meier
Hi,

adapting to the client timezone can be done in the component, a
converter or a model. e.g.

https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/ZonedToLocalDateTimeModel.java

Whatever fits your use-case. Maybe you want everything to be displayed
in the client timeZone -> register a global converter.

Have fun
Sven


On 13.01.20 06:05, Илья Нарыжный wrote:

> Hello,
>
> I have some fundamental question about Wicket:)
> For users it's convenient when date-time has shown in their timezone.
> So most of wicket devs, do that somehow like we did it here:
> https://github.com/OrienteerBAP/Orienteer/blob/master/orienteer-core/src/main/java/org/orienteer/core/component/property/date/ODateLabel.java
> But question is: does it make sense to put conversion per time-zone
> into DateConverter or that might broke something wicket
> best-practices?
>
> Thanks,
> Ilya
> ---------------------------------------------
> Orienteer(http://orienteer.org) - open source Business Application Platform
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Converters for Date/Time

Martin Terra
How about feedback messages etc.?

**
Martin

ma 13. tammik. 2020 klo 18.46 Sven Meier ([hidden email]) kirjoitti:

> Hi,
>
> adapting to the client timezone can be done in the component, a
> converter or a model. e.g.
>
>
> https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/ZonedToLocalDateTimeModel.java
>
> Whatever fits your use-case. Maybe you want everything to be displayed
> in the client timeZone -> register a global converter.
>
> Have fun
> Sven
>
>
> On 13.01.20 06:05, Илья Нарыжный wrote:
> > Hello,
> >
> > I have some fundamental question about Wicket:)
> > For users it's convenient when date-time has shown in their timezone.
> > So most of wicket devs, do that somehow like we did it here:
> >
> https://github.com/OrienteerBAP/Orienteer/blob/master/orienteer-core/src/main/java/org/orienteer/core/component/property/date/ODateLabel.java
> > But question is: does it make sense to put conversion per time-zone
> > into DateConverter or that might broke something wicket
> > best-practices?
> >
> > Thanks,
> > Ilya
> > ---------------------------------------------
> > Orienteer(http://orienteer.org) - open source Business Application
> Platform
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Converters for Date/Time

Sven Meier
Hi,

values in feedback messages get converted too of course, so if you want
that, a converter is a good option.
Note that components can use a specific converter by overriding
createConverter().

Many options to choose from :)

Sven


On 13.01.20 17:52, Martin Terra wrote:

> How about feedback messages etc.?
>
> **
> Martin
>
> ma 13. tammik. 2020 klo 18.46 Sven Meier ([hidden email]) kirjoitti:
>
>> Hi,
>>
>> adapting to the client timezone can be done in the component, a
>> converter or a model. e.g.
>>
>>
>> https://github.com/apache/wicket/blob/master/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/datetime/ZonedToLocalDateTimeModel.java
>>
>> Whatever fits your use-case. Maybe you want everything to be displayed
>> in the client timeZone -> register a global converter.
>>
>> Have fun
>> Sven
>>
>>
>> On 13.01.20 06:05, Илья Нарыжный wrote:
>>> Hello,
>>>
>>> I have some fundamental question about Wicket:)
>>> For users it's convenient when date-time has shown in their timezone.
>>> So most of wicket devs, do that somehow like we did it here:
>>>
>> https://github.com/OrienteerBAP/Orienteer/blob/master/orienteer-core/src/main/java/org/orienteer/core/component/property/date/ODateLabel.java
>>> But question is: does it make sense to put conversion per time-zone
>>> into DateConverter or that might broke something wicket
>>> best-practices?
>>>
>>> Thanks,
>>> Ilya
>>> ---------------------------------------------
>>> Orienteer(http://orienteer.org) - open source Business Application
>> Platform
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]