1

I'm trying to format my date value to M/d/yy using the Angular datepipe. It works in localhost wery well but when to deploy on remote server - the datepipe sets an incorrect format - YYYY-MM-DD HH-MM.

There my code:

@Component({
  selector: 'app-date',
  template:
    '<span>{{ curDate | date: this.dateFormat }}</span>',
})
export class DateComponent<M> extends BaseComponent<M> {
  dateFormat = 'M/d/yy';
  curDate = this.date // 2021-03-24T07:57:50.711Z

}

Can someone help me with this?

Dmitry S.
  • 1,544
  • 2
  • 13
  • 22
  • There's no issue in your code. If you can add more detail regarding your error/ code then we can look into what's the issue for not working. – Yaseer Mar 25 '21 at 03:57
  • I don't think you should have to use `this` in your template, It can just be `{{ curDate | date: dateFormat }}` – pjpscriv Aug 04 '21 at 11:08

0 Answers0