Author Topic: Tag value dates display calendar depending on regional settings  (Read 3269 times)

Mauricio Moya (Arquesoft)

  • EA User
  • **
  • Posts: 340
  • Karma: +8/-4
  • EA Consulting and development in Spanish
    • View Profile
    • Arquehub Azure Module
When you use Tagged Value Types and define one of them as "Date", the tag value displays a calendar when you click it so you can set a given date.
But, if, for example, your regional settings in windows are set as dd/mm/yyyy and you store a date as 04/03/2022 (march 4th) and another user in a different computer has a regional setting like mm/dd/2022, the calendar component assume the date as april 3rd.

Is there a way to deal with it, preserving the regional settings of the users?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Tag value dates display calendar depending on regional settings
« Reply #1 on: March 19, 2022, 07:42:33 am »
Of course nobody at Sparx thought that would happen. I would not rely on any of those gimmicks. Store the date as string with a set convention as yyyy-mm-dd.

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8604
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Tag value dates display calendar depending on regional settings
« Reply #2 on: March 19, 2022, 10:44:54 am »
Of course, nobody at Sparx thought that would happen. I would not rely on any of those gimmicks. Store the data as a string with a set convention as yyyy-mm-dd.

q.
Since ALL tagged values are stored as simple strings, there's NO way to avoid this problem.  Since you don't know the timezone of the original entry, you can't convert on output.  If you operate in multiple timezones, you may need to add the timezone to your string so that the date is accurate, in addition to q's format.


Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: Tag value dates display calendar depending on regional settings
« Reply #3 on: March 19, 2022, 07:00:11 pm »
I don't think you need a timezone unless you actually use time in terms of hours (and finer grained). Days are days and nobody cares about the overlap that happens on a few islands in a large ocean ;-)

q.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8604
  • Karma: +256/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Tag value dates display calendar depending on regional settings
« Reply #4 on: March 19, 2022, 10:30:42 pm »
I don't think you need a timezone unless you actually use time in terms of hours (and finer-grained). Days are days and nobody cares about the overlap that happens on a few islands in a large ocean ;-)

q.
That is unfortunately not true, dates aren't always dates.  A few of my assignments have involved worldwide time and date management.  It's not always so simple.

Hopefully, in this case, it is, but various scenarios should be checked first.  Living as we do at the eastern end of the world; it's much more apparent than for you guys who live in Europe close to  "UTC central".

Paolo
« Last Edit: March 19, 2022, 10:32:32 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!