Skip to content

Commit

Permalink
Update templates from Bravo repo (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
albertospelta authored Jun 27, 2022
1 parent 9a20abc commit d951362
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 13 deletions.
18 changes: 15 additions & 3 deletions src/Dax.Template.TestUI/Templates/DateTemplate-01.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@
"Name": "__WorkingDays",
"Expression": "@@GETCONFIG( WorkingDays )",
"IsConfigurable": true
},
{
"Name": "__IsStandardLocale",
"Expression": "IF ( FORMAT( DATE( 2000, 1, 1 ), \"oooo\"@@GETISO() ) = \"oooo\", TRUE, FALSE )"
},
{
"Name": "__DayFormatString",
"Expression": "IF( __IsStandardLocale, \"ddd\", \"aaa\" )"
},
{
"Name": "__MonthFormatString",
"Expression": "IF( __IsStandardLocale, \"mmm\", \"ooo\" )"
}
],
"RowVariables": [
Expand Down Expand Up @@ -60,7 +72,7 @@
},
{
"Name": "__WeekDay",
"Expression": "FORMAT ( __Date, \"ddd\"@@GETISO() )"
"Expression": "FORMAT ( __Date, __DayFormatString@@GETISO() )"
},
{
"Name": "__FiscalYearNumber",
Expand Down Expand Up @@ -131,7 +143,7 @@
},
{
"Name": "Year Month",
"Expression": "FORMAT ( __Date, \"mmm yyyy\"@@GETISO() )",
"Expression": "FORMAT ( __Date, __MonthFormatString & \" yyyy\"@@GETISO() )",
"DataType": "String",
"SortByColumn": "Year Month Number",
"DataCategory": "Months"
Expand All @@ -146,7 +158,7 @@
},
{
"Name": "Month",
"Expression": "FORMAT ( __Date, \"mmm\"@@GETISO() )",
"Expression": "FORMAT ( __Date, __MonthFormatString@@GETISO() )",
"DataType": "String",
"SortByColumn": "Month Number",
"DataCategory": "MonthOfYear"
Expand Down
14 changes: 11 additions & 3 deletions src/Dax.Template.TestUI/Templates/DateTemplate-02.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
"0 - First day of fiscal year",
"1 - Last day of fiscal year"
]
},
{
"Name": "__IsStandardLocale",
"Expression": "IF ( FORMAT( DATE( 2000, 1, 1 ), \"oooo\"@@GETISO() ) = \"oooo\", TRUE, FALSE )"
},
{
"Name": "__MonthFormatString",
"Expression": "IF( __IsStandardLocale, \"mmm\", \"ooo\" )"
}
],
"RowVariables": [
Expand Down Expand Up @@ -133,7 +141,7 @@
"IF (",
" __MonthNumber > 12,",
" FORMAT ( __MonthNumber, \"@_M_@00\"@@GETISO() ),",
" FORMAT ( __MonthDate, \"mmm\"@@GETISO() )",
" FORMAT ( __MonthDate, __MonthFormatString@@GETISO() )",
")"
],
"DataType": "String",
Expand All @@ -154,7 +162,7 @@
"IF (",
" __MonthNumber > 12,",
" FORMAT ( __MonthNumber, \"@_M_@00\"@@GETISO() ) & FORMAT ( __YearNumber, \" 0000\"@@GETISO() ),",
" FORMAT ( __MonthDate, \"mmm yyyy\"@@GETISO() )",
" FORMAT ( __MonthDate, __MonthFormatString & \" yyyy\"@@GETISO() )",
")"
],
"DataType": "String",
Expand Down Expand Up @@ -214,7 +222,7 @@
"IF (",
" __MonthNumber > 12,",
" FORMAT ( __MonthNumber, \"@_M_@00\"@@GETISO() ),",
" FORMAT ( __MonthDate, \"mmm\"@@GETISO() )",
" FORMAT ( __MonthDate, __MonthFormatString@@GETISO() )",
")"
],
"DataType": "String",
Expand Down
18 changes: 15 additions & 3 deletions src/Dax.Template.TestUI/Templates/DateTemplate-03.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@
{
"Name": "__OffsetFiscalYearOnOrAfterMonth",
"Expression": "IF ( __FirstFiscalMonth > 1, __TypeStartFiscalYear, 0 )"
},
{
"Name": "__IsStandardLocale",
"Expression": "IF ( FORMAT( DATE( 2000, 1, 1 ), \"oooo\"@@GETISO() ) = \"oooo\", TRUE, FALSE )"
},
{
"Name": "__DayFormatString",
"Expression": "IF( __IsStandardLocale, \"ddd\", \"aaa\" )"
},
{
"Name": "__MonthFormatString",
"Expression": "IF( __IsStandardLocale, \"mmm\", \"ooo\" )"
}
],
"RowVariables": [
Expand Down Expand Up @@ -118,7 +130,7 @@
},
{
"Name": "__WeekDay",
"Expression": "FORMAT ( __Date, \"ddd\"@@GETISO() )"
"Expression": "FORMAT ( __Date, __DayFormatString@@GETISO() )"
},
{
"Name": "__HolidayName",
Expand Down Expand Up @@ -161,7 +173,7 @@
},
{
"Name": "Year Month",
"Expression": "FORMAT ( __Date, \"mmm yyyy\"@@GETISO() )",
"Expression": "FORMAT ( __Date, __MonthFormatString & \" yyyy\"@@GETISO() )",
"DataType": "String",
"SortByColumn": "Year Month Number",
"DataCategory": "Months"
Expand Down Expand Up @@ -212,7 +224,7 @@
},
{
"Name": "Month",
"Expression": "FORMAT ( __Date, \"mmm\"@@GETISO() )",
"Expression": "FORMAT ( __Date, __MonthFormatString@@GETISO() )",
"DataType": "String",
"SortByColumn": "Fiscal Month Number",
"DataCategory": "MonthOfYear"
Expand Down
18 changes: 15 additions & 3 deletions src/Dax.Template.TestUI/Templates/DateTemplate-04.json
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,18 @@
{
"Name": "__FirstWeekReference",
"Expression": "__FirstSundayReference + __FirstDayOfWeek"
},
{
"Name": "__IsStandardLocale",
"Expression": "IF ( FORMAT( DATE( 2000, 1, 1 ), \"oooo\"@@GETISO() ) = \"oooo\", TRUE, FALSE )"
},
{
"Name": "__DayFormatString",
"Expression": "IF( __IsStandardLocale, \"ddd\", \"aaa\" )"
},
{
"Name": "__MonthFormatString",
"Expression": "IF( __IsStandardLocale, \"mmm\", \"ooo\" )"
}
],
"RowVariables": [
Expand Down Expand Up @@ -264,7 +276,7 @@
},
{
"Name": "__FiscalYearMonth",
"Expression": "FORMAT ( __FiscalStartOfMonth + 14, \"@_FM_@ mmm yyyy\"@@GETISO() )"
"Expression": "FORMAT ( __FiscalStartOfMonth + 14, \"@_FM_@ \" & __MonthFormatString & \" yyyy\"@@GETISO() )"
},
{
"Name": "__FiscalStartOfMonth",
Expand Down Expand Up @@ -298,7 +310,7 @@
},
{
"Name": "__FiscalMonth",
"Expression": "FORMAT ( __FiscalStartOfMonth + 14, \"@_FM_@ mmm\"@@GETISO() )"
"Expression": "FORMAT ( __FiscalStartOfMonth + 14, \"@_FM_@ \" & __MonthFormatString@@GETISO() )"
},
{
"Name": "__FiscalYearQuarterNumber",
Expand All @@ -322,7 +334,7 @@
},
{
"Name": "__WeekDay",
"Expression": "FORMAT ( __Date, \"ddd\"@@GETISO() )"
"Expression": "FORMAT ( __Date, __DayFormatString@@GETISO() )"
},
{
"Name": "__FiscalDayOfMonthNumber",
Expand Down
57 changes: 56 additions & 1 deletion src/Dax.Template.TestUI/Templates/HolidaysDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,61 @@
"HolidayName": "День народного единства",
"SubstituteHoliday": "NoSubstituteHoliday",
"ConflictPriority": 100
},
{
"IsoCountry": "CN",
"MonthNumber": 1,
"DayNumber": 1,
"WeekDayNumber": 0,
"OffsetWeek": 0,
"OffsetDays": 0,
"HolidayName": "元旦",
"SubstituteHoliday": "NoSubstituteHoliday",
"ConflictPriority": 100
},
{
"IsoCountry": "CN",
"MonthNumber": 5,
"DayNumber": 1,
"WeekDayNumber": 0,
"OffsetWeek": 0,
"OffsetDays": 0,
"HolidayName": "劳动节",
"SubstituteHoliday": "NoSubstituteHoliday",
"ConflictPriority": 100
},
{
"IsoCountry": "CN",
"MonthNumber": 10,
"DayNumber": 1,
"WeekDayNumber": 0,
"OffsetWeek": 0,
"OffsetDays": 0,
"HolidayName": "国庆节",
"SubstituteHoliday": "NoSubstituteHoliday",
"ConflictPriority": 100
},
{
"IsoCountry": "CN",
"MonthNumber": 10,
"DayNumber": 2,
"WeekDayNumber": 0,
"OffsetWeek": 0,
"OffsetDays": 0,
"HolidayName": "国庆节",
"SubstituteHoliday": "NoSubstituteHoliday",
"ConflictPriority": 100
},
{
"IsoCountry": "CN",
"MonthNumber": 10,
"DayNumber": 3,
"WeekDayNumber": 0,
"OffsetWeek": 0,
"OffsetDays": 0,
"HolidayName": "国庆节",
"SubstituteHoliday": "NoSubstituteHoliday",
"ConflictPriority": 100
}
]
}
}

0 comments on commit d951362

Please sign in to comment.