Questions tagged [date-pipe]

Angular's date pipe that transforms a date into various formats.

119 questions
1
vote
1 answer

Transforming Date in Two-Way Bound Property in Angular 2 App

I have a date being displayed in my Angular 2 app that is printing in an undesired format, like this: 2012-04-02T00:00:00.000Z What I'd like to do is use Angular's date pipe to transform this data so it prints in a more human-friendly format. Is…
Rey
  • 1,393
  • 1
  • 15
  • 24
1
vote
1 answer

Using Angular's Date Pipe on Input with 2-Way Binding

I am aware of how to use Angular's date pipe with typical string interpolation examples and/or for loops. However, I have a situation that's different than both these scenarios - where I've created a kind of custom two-way binding in my Angular 2…
Rey
  • 1,393
  • 1
  • 15
  • 24
1
vote
1 answer

Angular 4 / Angular-cli: Date Polyfill with Internationalization API does not work

I can not seem to get the polyfill of the Internationalization API to work. As stated in the docs (https://angular.io/docs/ts/latest/guide/pipes.html) one simply needs to add a script to your index.html:
BigPenguin
  • 264
  • 2
  • 17
0
votes
1 answer

date pipe does not work for elements with FormControlName property set

Using reactive-forms sample application I have added curr_date form control which has a pipe to format the date in desired format. In ts file, form group has the curr_date property which has preset value in different format.
Ajit_S
  • 3
  • 2
0
votes
0 answers

angular date display GMT time

In my angular application I have a date string (2023-06-20T06:15:00) which I need to format and display as 06/20/2023 at 06:15PM (GMT-5) I am using Angular Datepipe like below and it displays, Tue Jun 20 2023 00:00:00 GMT-0500 (Central Daylight…
user1015388
  • 1,283
  • 4
  • 25
  • 45
0
votes
0 answers

Sensors Location in Date Pipe

I have a timestamp, 1674169200000. In french format, in GMT+1, I wish an hour set to 00:00:00. When I use this.datePipe.transform(1674169200000, 'mediumTime') with a french location (in debug mode : Sensors -> no override, Timezone ID =…
Lainea
  • 15
  • 5
0
votes
2 answers

Angular DatePipe

I want to display date and time in html like this: 19 Jan 2023. at 14:15 I am using this DatePipe: {{order.updatedAt | date: 'dd MMM, y. h:mm a'}} When I place "at" like this: {{order.updatedAt | date: 'dd MMM, y. at h:mm a'}}, I am given this…
0
votes
0 answers

The year is displayed wrong while using Date pipe and moment.js (Angular 13)

I'm using Moment.js to convert my date , but it displayed a wrong year below a part of my code in localized-moment.ts file : transform(value: any, pattern: string = 'short'): any { if (value.toString().includes('-')) { return…
Ael9643
  • 3
  • 2
0
votes
1 answer

How can I avoid getting this error while parsing an input date with this format dd/mm/yyyy to yyyy-mm-dd?

I'm trying to parse a date with this format dd/mm/yyyy to yyyy-mm-dd with typescript in order to send the correct format to an API request. I'm using this function before sending the request: formatDateForBE(date: string): string { if (date) {…
lyon
  • 23
  • 3
0
votes
0 answers

sorting date pipe in ascending order using custom date pipe in angular 12

Hi I'm trying to sort the dates in ascending order instead of decending. This is the code I that I have currently. custome.pipe.ts import {pipe, pipetransform} from '@angular/core'; import * moment from 'moment' @pipe({ name:…
0
votes
2 answers

how to remove the 00:00:00.000000 Angular

How to remove the Date 00:00:00.000000 in this 2022-08-07 00:00:00.0000000 format? Date
Yan
  • 149
  • 1
  • 9
0
votes
2 answers

How to convert UK DateTime to GMT time in angular

I am working on a angular project. I want to the start time and off time of a office in a table. Example : 8:30 - 17:30 The office has two branches in UK and India. So user may enter time in UK time or Indian time. But I am going to store the time…
hanushi
  • 1,169
  • 2
  • 12
  • 27
0
votes
1 answer

how to translate angular datePipe's dates with moment.js?

I have this version of packages: "@angular/cdk": "^11.2.13", "@ngx-translate/core": "^13.0.0", "@angular/material-moment-adapter": "^12.2.9", "moment": "^2.29.1", "@types/moment": "^2.13.0", I am using angular datePipe | date: 'MMM d, y' …
0
votes
1 answer

Date pipe in reactive forms

What's the correct way to display a date pipe in a reactive form? app-component.html
0
votes
1 answer

How to use date-pipe inside for loop in angular?

I want to use date-pipe for the values of my dictionary. So I tried this.
  • {{field.key}}: {{field.value | date:'d MMM y'}} but got an error Error:…