File tree Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Expand file tree Collapse file tree 3 files changed +12
-13
lines changed Original file line number Diff line number Diff line change @@ -82,17 +82,16 @@ function output(data, argv) {
8282 }
8383
8484
85- // TODO: this formatter do sort by date, we can`t change output because customers can grep it
86- // // if no pretty flag and no dateFormat - force apply specific entity date format
87- // if (!pretty && (!dateFormat || dateFormat === 'default')) {
88- // const formatter = FormatterRegistry.get(entities[0].constructor.name);
89- // _.keys(info).forEach((key) => {
90- // const prop = info[key];
91- // if (prop instanceof Date) {
92- // info[key] = formatter.applyStyles(key, prop);
93- // }
94- // });
95- // }
85+ // if no pretty flag and no dateFormat - force apply specific entity date format
86+ if ( ! pretty && ( ! dateFormat || dateFormat === 'default' ) ) {
87+ const formatter = FormatterRegistry . get ( entities [ 0 ] . constructor . name ) ;
88+ _ . keys ( info ) . forEach ( ( key ) => {
89+ const prop = info [ key ] ;
90+ if ( prop instanceof Date ) {
91+ info [ key ] = formatter . applyStyles ( key , prop ) ;
92+ }
93+ } ) ;
94+ }
9695
9796 if ( pretty ) {
9897 const formatter = FormatterRegistry . get ( entities [ 0 ] . constructor . name ) ;
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ class TestEntity extends Entity {
3939
4040
4141// todo: add other tests on coverage
42- describe . skip ( 'table output' , ( ) => {
42+ describe ( 'table output' , ( ) => {
4343 describe ( 'date format' , ( ) => {
4444 it ( 'should apply default entity date format when no pretty flag and no date format are passed' , ( ) => {
4545 const argv = { } ; // no pretty flag
Original file line number Diff line number Diff line change 11{
22 "name" : " codefresh" ,
3- "version" : " 0.11.0 " ,
3+ "version" : " 0.11.1 " ,
44 "description" : " Codefresh command line utility" ,
55 "main" : " index.js" ,
66 "preferGlobal" : true ,
You can’t perform that action at this time.
0 commit comments