cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Want to bind a Localizable property, to give end user choice for its own DateTime Format

JU_10321794
8-Gravel

Want to bind a Localizable property, to give end user choice for its own DateTime Format

Goal:

The end user must be able to set its own date time format.

 

Option that doesn't solve all of my problems:

the property FormatToken can be set for the Date Time Picker Widget to a Localization Token.

Same goes for Grid widget Column render settings.

 

Problem:

The Localization Token only sets the format for the dateTime string at a langue lvl.

 

Part of the solution:

I let the end user set its own DateTime Display settings, save that as User parameters.

A service that converts the DateTime to the string using the User parameters.

So, I call the service so when i need to display DateTime in a Grid or label so it converts it.

So displaying datetime format on a grid or label is solved. And works fine.

 

unsolved part:

But i cant do the same thing for the Date Time Picker Widget.

Because DateDelimiter and FormatToken properties are only Localizable and not Bindable i cant set them.

 

I can think of 2 dirty solutions

1 when i set the Localization Token from a i can make a service that overwrites the Token before displaying the Time Picker Widget.

2 make a Localization Table for each user.

Well my dirty solutions are so dirty that they should never be implemented.

 

Questions:

Can anyone think of a good solution?

Did any of you try to do this before?

Is there a way bind a Localization Token to a User parameter?(this would solve everything, and would be very powerful feature)

1 ACCEPTED SOLUTION

Accepted Solutions

Well, i think it should be bindable. so i put it up as an idea:

https://community.ptc.com/t5/ThingWorx-Ideas/make-FormatToken-bindable-to-give-end-user-choice-for-its-own/idi-p/812238

It would be very easy to implement if the format was bindable.

View solution in original post

4 REPLIES 4
PaiChung
22-Sapphire I
(To:JU_10321794)

I would pre-set what date time formats can be picked, vs. allowing the user to pick their own custom one.

Then you can have their datetime token of choice saved within their user extensions and then use something like an expression widget and services to format their data

A big list of pre-sets could work for me.

But then i still run in the same problem, if i want to set the FormatToken in the DateTimePicker Widget.

Because DateDelimiter and FormatToken properties are only Localizable and not Bindable.

PaiChung
22-Sapphire I
(To:JU_10321794)

Just checked this and indeed that isn't bindable

Not too sure what would work to give a user full range over their date time formatting that isn't 'language' bound

Well, i think it should be bindable. so i put it up as an idea:

https://community.ptc.com/t5/ThingWorx-Ideas/make-FormatToken-bindable-to-give-end-user-choice-for-its-own/idi-p/812238

It would be very easy to implement if the format was bindable.

Top Tags