Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Dax.Template/Tables/Dates/BaseDateTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ public BaseDateTemplate(T config, CustomTemplateDefinition template, Predicate<C
protected override string? GetDefaultFormatString(Dax.Template.Model.Column column, Microsoft.AnalysisServices.Tabular.Model model)
{
string isoCulture = string.IsNullOrWhiteSpace(IsoFormat) ? model.Culture : IsoFormat;
// useUserOverride: false - a template must produce the same DAX/TOM output regardless of the
// machine's personal Windows regional-format overrides (Control Panel > Region), which
// `new CultureInfo(name)` otherwise applies by default even for a fully-qualified culture name.
return (column.DataType == DataType.DateTime)
? new CultureInfo(isoCulture).DateTimeFormat.ShortDatePattern.Replace('M', 'm')
? new CultureInfo(isoCulture, useUserOverride: false).DateTimeFormat.ShortDatePattern.Replace('M', 'm')
: null;
}

Expand Down
Loading