Skip to main content
1-Visitor
November 4, 2019
Question

Varying Time Stamp Localization token based on User Extension

  • November 4, 2019
  • 2 replies
  • 3338 views

Hello,

 

I have a requirement where I need Vary the Timestamp (12hr/24hr) Format in the Localization Token (dateTimeFormat_Default) based on the User Extension. So that the End User (at the time of registering) will select his preferred time Format and the whole application where ever the timestamps are present will show up in the as per their preference.

Is this is possible. If Yes, how do we do it.

As of now I have a Idea of writing a service for each and every label or grid where timestamp is being shown. But, it is not Idealistic and a mundane task to do.  

 

2 replies

22-Sapphire I
November 5, 2019

Swapping between 12hr and 24hr format.

I've never been on a project that had this requirement.

If it is just labels, you could run the timestamp through an expression which either leaves it or converts it to the other format.

that doesn't capture data labels in a grid I think

It might do the actual infotable payload, but you may have to convert that server side.

1-Visitor
November 5, 2019

Hi Pai,

Thanks for you Inputs.

 

I too thought so. But, we cannot check the User Extensions in the Expressions. So I had to go for a Service (which I am already Implementing.)

 

My ask is.. Is there any way to modify the localization Tokens of DateTime Format (Ex. dateTimeFormat_Default) in the run time based on User Extension? (I have created a User extension which saves stores the User Time Format Preference)

22-Sapphire I
November 5, 2019

You get user extensions in the runtime from the User tab on the right side where there is Data/Session/User

18-Opal
November 10, 2019

Hello @SaiPrakash,

 

Another option would be to create two labels for each value (one with 12h format, another one with 24h), overlay them in the mashup and control their visibility via a simple validator. This solution is far from ideal, but at least avoids writing 45 expressions (you can use the same validator to show/hide all 12/24 labels at once).

 

A side remark -- if I had 45 labels on the same form I would seriously consider using a Grid or Collection instead of Labels.

 

/ Constantine