misal kita butuh tanggal jatuh tempo 7 hari dari tanggal sekarang dsb
tambahkan pad component.ts dan module.ts (provider)
import { DatePipe } from '@angular/common';
pada contructor
private datePipe: DatePipe
buat fungsi
clicFunction() {
const xx = new Date();
const yy = xx.setDate( xx.getDate() + 3 ); console.log(this.datePipe.transform(yy, 'yyyy-MM-dd'));
}
Subscribe to:
Post Comments (Atom)
0 Response to "tambah hari / tanggal new tanggal / "
Post a Comment