-
-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: DataGrid : DatePicker Column isn't compatible with DisplayFormat #5837
Comments
Not sure. |
I don-t understand your question. I just showed you the differences with the screenshots. Cell Display vs DatePicker input. |
Sorry, I was looking at the wrong date input in the image. Yeah, I see the problem now. Whichever path we take will be a breaking change/behavior for our users. If we tell them to now write "dd.MM.yyyy" instead of "{0:dd.MM.yyyy}" as previously, or if they replace I'm more open to telling them to do "dd.MM.yyyy" instead of "{0:dd.MM.yyyy}" as that will not introduce any new API. |
Dumb idea.. What if we parse and convert "{0:dd.MM.yyyy}" to "dd.MM.yyyy"? |
ChatGPT 😅 public static string ConvertToSimpleDateFormat(string inputFormat)
{
var match = Regex.Match(inputFormat, @"\{0:(.+?)\}");
if (match.Success)
{
return match.Groups[1].Value;
}
return inputFormat;
} |
Well first of all why are we even using this type of format "{0:}" ? Was there a special reason for it? Seems weird to define it like this honestly. I'd expect it to work just like : "dd.MM.yyyy". Now, we could wait for 2.0 to make that breaking change, and just try to infer the proper format for DatePicker as you mention. |
I have no idea TBH. It was so long ago that I really don't know the reason by now. |
Lol, don't let your "brain rot" by depending on it too much. StartsWith and EndsWith works equally well in this case. Probably more readable even. |
My brain is already rot from a lack of sleep from looking at my 1 year old 😅 |
@stsrki
I Remember now why we had a separate DateDisplayFormat.
The DisplayFormat isn't really compatible with the DatePicker format style. It seems to use a string.format
DisplayFormat="{0:dd.MM.yyyy}"
UI
DatePicker
DisplayFormat="dd.MM.yyyy"
UI
DatePicker
What do you think, should we revert back?
The text was updated successfully, but these errors were encountered: