Skip to content

Commit

Permalink
feat: monthName dayOfWeekName formulas return names in the current la…
Browse files Browse the repository at this point in the history
…nguage [PT-187799270]
  • Loading branch information
pjanik committed Jul 23, 2024
1 parent 3a59eef commit e2e675a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions v3/src/models/formula/functions/date-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ export const dateFunctions = {
'DG.Formula.DateLongMonthNovember',
'DG.Formula.DateLongMonthDecember'
]
// V2 would return the month name in local language, but V3 always returns it in English.
// I think that makes more sense, as otherwise it's not possible to use the result in further calculations.
return dateObject ? t(monthNames[dateObject.getMonth()], { lang: "en" }) : UNDEF_RESULT
return dateObject ? t(monthNames[dateObject.getMonth()]) : UNDEF_RESULT
}
},

Expand Down Expand Up @@ -81,9 +79,7 @@ export const dateFunctions = {
'DG.Formula.DateLongDayFriday',
'DG.Formula.DateLongDaySaturday'
]
// V2 would return the day of the week name in local language, but V3 always returns it in English.
// I think that makes more sense, as otherwise it's not possible to use the result in further calculations.
return dateObject ? t(dayNames[dateObject.getDay()], { lang: "en" }) : UNDEF_RESULT
return dateObject ? t(dayNames[dateObject.getDay()]) : UNDEF_RESULT
}
},

Expand Down

0 comments on commit e2e675a

Please sign in to comment.