@genesislcap/blank-app-seed 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.genx/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from '@microsoft/fast-element';
|
|
2
|
-
import { getNumberFormatter{{#if route.FDC3EventHandlersEnabled}}, sendEventOnChannel{{/if}} } from '../../utils';
|
|
2
|
+
import { getDateFormatter, getNumberFormatter{{#if route.FDC3EventHandlersEnabled}}, sendEventOnChannel{{/if}} } from '../../utils';
|
|
3
3
|
import type { {{pascalCase route.name}} } from './{{kebabCase route.name}}';
|
|
4
4
|
|
|
5
5
|
export const {{pascalCase route.name}}Template = html<{{pascalCase route.name}}>`
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.3.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.2.0...v3.3.0) (2024-04-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add getDateFormatter GENC-318 (#190) 2008ee6
|
|
9
|
+
|
|
3
10
|
## [3.2.0](https://github.com/genesiscommunitysuccess/blank-app-seed/compare/v3.1.0...v3.2.0) (2024-04-23)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import Numeral from 'numeral';
|
|
2
2
|
import 'numeral/locales';
|
|
3
3
|
|
|
4
|
+
const defaultDateOptions: Intl.DateTimeFormatOptions = {
|
|
5
|
+
year: 'numeric',
|
|
6
|
+
month: '2-digit',
|
|
7
|
+
day: '2-digit',
|
|
8
|
+
timeZone: 'UTC',
|
|
9
|
+
};
|
|
10
|
+
|
|
4
11
|
export function getNumberFormatter(format: string, locale?: string) {
|
|
5
12
|
return (params) => {
|
|
6
13
|
if (!(params && typeof params.value === 'number')) return '';
|
|
@@ -12,3 +19,14 @@ export function getNumberFormatter(format: string, locale?: string) {
|
|
|
12
19
|
return Numeral(params.value).format(format);
|
|
13
20
|
};
|
|
14
21
|
}
|
|
22
|
+
|
|
23
|
+
export function getDateFormatter(
|
|
24
|
+
locale: string = 'en-GB',
|
|
25
|
+
options: Intl.DateTimeFormatOptions = defaultDateOptions,
|
|
26
|
+
) {
|
|
27
|
+
return (params) => {
|
|
28
|
+
if (!(params && typeof params.value === 'number')) return '';
|
|
29
|
+
|
|
30
|
+
return new Intl.DateTimeFormat(locale, options).format(params.value);
|
|
31
|
+
};
|
|
32
|
+
}
|