0

Please how can i change my shortDate format in my template file Tried this but showing date in "/" format, I want it to formatted with "-" i want the output to be yyyy-MM-dd

  <ngx-datatable-column name="CHECK_IN_TIME"  prop="CHECK_IN_TIME">
     <ng-template let-row="row" ngx-datatable-cell-template>
        {{row.CHECK_IN_TIME | date:'shortDate'}}
     </ng-template>
   </ngx-datatable-column>
Francis
  • 53
  • 1
  • 8

1 Answers1

0

you can use something like this :

{{dateSample | date: 'yyyy-mm-dd' }}

here's a sample :

https://stackblitz.com/edit/angular-cjhn5e?file=src%2Fapp%2Fselect-custom-trigger-example.html

Nicho
  • 606
  • 1
  • 10
  • 24
  • Thank you, besides how can i calculate hours and minutes between two different times. eg. 10:30 am - 12:00am will give me 01:30mins. Thanks for the help – Francis Jun 10 '20 at 03:16
  • u can check code from https://stackoverflow.com/questions/29745873/hour-difference-between-two-timeshhmmss-ain-momentjs and https://stackoverflow.com/questions/26580509/calculate-time-difference-between-two-date-in-hhmmss-javascript – Nicho Jun 10 '20 at 03:33