1

For our Angular 4 application I'm using ngx-translate with messageformat.js for handling internationalization and localization. Is it possible to get the format string of shortdate of a date object ie. 'YYYY-MM-dd'?

ie: new Date().formatString('en-US') returns: 'YYYY-MM-dd'

bjorkblom
  • 1,849
  • 3
  • 21
  • 31

1 Answers1

-1
const pipe: DatePipe = new DatePipe(locale) //en-Ukr
return pipe.transform(value, 'y-MM-DD') // value = new Date()
'2017-12-04'
DmitriyKhirniy
  • 245
  • 1
  • 7