2

I've prepared a small WPF app:

View:

enter image description here

and the View-Model looks as following:

enter image description here

And now, for some reason there are spaces between the Day, Month and year for the Slovenian culture:

enter image description here

I mean that intead of getting 14.01.2019, I get 14. 01. 2019.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
Cod Fish
  • 917
  • 1
  • 8
  • 37
  • Whatever it is (see answers below), it most definitely isn't a C# bug, as that's a programming language. – CodeCaster Jan 14 '19 at 09:04
  • 1
    @IanKemp: I don't think that's really the case - see my answer, which cites the Unicode CLDR. That's pretty much the canonical source of information here. – Jon Skeet Jan 14 '19 at 09:12
  • @JonSkeet Using archaic knowledge you gained developing NodaTime is cheating. :p But thanks for that, I had no idea the CLDR existed until now, next time I have a culture formatting-related question I know where to go! – Ian Kemp Jan 14 '19 at 09:17
  • Some related informations on this matter: [Why might my local machine be incorrectly formatting international dates?](https://stackoverflow.com/a/53138834/7444103) – Jimi Jan 14 '19 at 09:35

2 Answers2

6

This is correct behavior according to Unicode CLDR. The easiest way of exploring the data is via the GitHub repository of JSON format files. The generic dates file for "sl" (there's no specific sl-SI directory) contains this section:

"dateFormats": {
  "full": "EEEE, dd. MMMM y G",
  "long": "dd. MMMM y G",
  "medium": "d. MMM y G",
  "short": "d. MM. yy GGGGG"
}

So that looks like .NET is doing the right thing.

Jon Skeet
  • 1,421,763
  • 867
  • 9,128
  • 9,194
  • BTW, in case someone doesn't familiar with those formats, `G` is for "Era" and `E` is for day names. `EEEE` means wide day name like `Monday` and `GGGGG` means narrow description of "Era" like `A` (for `AD`). http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table – Soner Gönül Jan 14 '19 at 18:36
1

According to wiki Date format by country

  • Slovenia d. mm. yyyy or dd. mmmm yyyy

However ,i note the citation is actually a Microsoft page (the citation doesn't work atm)

So for it being a bug, i doubt it. As for being what most people there use (well it might depend who you ask)

TheGeneral
  • 79,002
  • 9
  • 103
  • 141