Release 1.297.4 (#2209)

This commit is contained in:
Thomas Kaul
2023-08-05 19:57:39 +02:00
committed by GitHub
parent 8ba50f2729
commit 42274917e0
8 changed files with 89 additions and 40 deletions

View File

@@ -234,6 +234,16 @@ export function isCurrency(aSymbol = '') {
return currencies[aSymbol];
}
export function interpolate(template: string, context: any) {
return template.replace(/[$]{([^}]+)}/g, (_, objectPath) => {
const properties = objectPath.split('.');
return properties.reduce(
(previous, current) => previous?.[current],
context
);
});
}
export function resetHours(aDate: Date) {
const year = getYear(aDate);
const month = getMonth(aDate);