Jump to content

unidbdatetimepicker within unidgrid using mm/dd/yy & dd/mm/yyyy


demetris

Recommended Posts

I need to run on the same machine 2  versions of the same application for different clients.

 

the one uses mm/dd/yyyy and the other dd/mm/yyyy

 

I do have a unidbgrid and in  it a date field edited by a unidbdatetimepicker.

 

 

The unidbdatetimepicker validates against the regional settings giving an error for the one with different format.

 

How can I get around this?

Link to comment
Share on other sites

This is how I did it:

 

https://unigui.miraheze.org/wiki/Format_Date_in_Local_Format

 

Basically, I  create a new copy of TFormatSettings and use their local setting in it.

 

Then I setup up some types of date formats:

MM/DD/YYYY

MM/DD/YY

etc.

 

Then I call fmtDate ( source is in the link)

 

and it changes MM/DD/YYYY to DD/MM/YYYY 

or MM/DD/YY to MM/DD/YY 

 

depending on what is in TFormatSettings

 

Let me know if you have any questions about the source in:

https://unigui.miraheze.org/wiki/Format_Date_in_Local_Format

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...