@bennerinformatics/ember-fw-table 2.1.2 → 2.1.3
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/addon/utils/formats.js
CHANGED
|
@@ -60,7 +60,7 @@ export function formatNullable(nullText = 'None') {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Generates a function which formats a
|
|
63
|
+
* Generates a function which formats a date based on the specified format. Designed to be used in the following way with a column displaying a date (after importing `formatMoment` in the way described above):
|
|
64
64
|
* ```js
|
|
65
65
|
* column: [
|
|
66
66
|
* //will display date as 1970-01-01
|
|
@@ -80,15 +80,18 @@ export function formatNullable(nullText = 'None') {
|
|
|
80
80
|
* @method formatMoment
|
|
81
81
|
* @param {String} format moment format. For a list of valid strings, see [Moment docs](https://momentjs.com/docs/#/displaying/format/)
|
|
82
82
|
* @param {String} exportFormat moment format used on exporting
|
|
83
|
-
* @return {Function} Function to pass into a column which formats
|
|
83
|
+
* @return {Function} Function to pass into a column which formats a date
|
|
84
84
|
*/
|
|
85
85
|
export function formatMoment(format, exportFormat = null) {
|
|
86
86
|
return function(date) {
|
|
87
|
+
if (!date) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
87
90
|
if (!moment.isMoment(date)) {
|
|
88
91
|
date = moment(date);
|
|
89
92
|
}
|
|
90
93
|
// if we are exporting and have an export format, use that
|
|
91
|
-
let useFormat = exportFormat && this
|
|
94
|
+
let useFormat = exportFormat && this.export ? exportFormat : format;
|
|
92
95
|
return date.format(useFormat);
|
|
93
96
|
};
|
|
94
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bennerinformatics/ember-fw-table",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Additional resources related to tables for the Ember FW App System.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"ember-cli-babel": "7.13.2",
|
|
24
24
|
"ember-cli-htmlbars": "^3.1.0",
|
|
25
|
-
"ember-light-table": "
|
|
25
|
+
"ember-light-table": "3.0.0-beta.1",
|
|
26
26
|
"ember-papaparse": "^1.0.0",
|
|
27
27
|
"ember-truth-helpers": "^2.1.0",
|
|
28
28
|
"sass": "1.32.13",
|
|
29
29
|
"papaparse": "^5.0.2"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@bennerinformatics/ember-fw": "^2.0.
|
|
32
|
+
"@bennerinformatics/ember-fw": "^2.0.32",
|
|
33
33
|
"broccoli-asset-rev": "^3.0.0",
|
|
34
34
|
"ember-ajax": "^5.0.0",
|
|
35
35
|
"ember-cli": "~3.10.0",
|