Angular's date pipe that transforms a date into various formats.
Questions tagged [date-pipe]
119 questions
0
votes
1 answer
Angular 4 DatePipe with current timezone
So I have a component where I need to display dates received from an endpoint, but these dates are stored in UTC I believe. So I've been trying to use DatePipe to display the date in a better format, but I also need the timezone to match the current…

Tuco
- 902
- 3
- 18
- 33
0
votes
1 answer
InvalidPipeArgument for DatePipe, IST timezone not supported by default
I have tried using DatePipe to format date values which I get from REST API. The format of the date string in REST API is like this: Wed Mar 28 12:20:11 IST 2018.
It works fine when the timezone in the string is UTC, EST etc. However it is resulting…

ramtech
- 757
- 6
- 15
0
votes
1 answer
Formatting a Datetime in Angular/Ionic
I was wondering how I can format the text and make some part of the datetime string bold?
For example I want to make my current date time format, which looks like: 02/19/2018 16:00 CST to 02/19/2018 16:00 CST.
This is the code that is generating…

terrabl
- 743
- 3
- 8
- 23
0
votes
1 answer
Angular2 DatePipe is not formatting according to browser language
I am using angular2 default DatePipe to format date according to browser locale/language.
In my case it always format date according to english language.
app.module.ts
{
provide: LOCALE_ID, useValue: "hi"
}
In my custom pipe i created…

Nitin Jain
- 123
- 7
0
votes
1 answer
Getting Date Formatted and Printed to Screen in Angular 2 App
I am trying to get the date pipe I'm using in my Angular app to parse out correctly when using it in the template within an input. Initially, before formatting the date, the code looked like this:

Rey
- 1,393
- 1
- 15
- 24
0
votes
1 answer
Handling Date Transformation in Component in Angular 2 App
I am trying to transform the way some dates are displayed in my Angular 2 app. In my case, using the date pipe in the view along with string interpolation is not an option, because my template code looks like this:

Rey
- 1,393
- 1
- 15
- 24
0
votes
1 answer
Pass language with Date Pipe in Angular 2 HTML template
In Angular2, we can format the date using DatePipe using typescript as:
new DatePipe(navigator.language || 'en-US').transform(mydate, 'medium')
But, I want to do this on HTML side. I read that I can do like this:
mydate | date:'medium'
But, this is…

user1892775
- 2,001
- 6
- 37
- 58
0
votes
1 answer
Convert numerical month to string using ionic 2 Pipe
How can I convert month to string in ionic 2 using Pipe? given the sample data below:
In my .ts file
let users = [
{
user: "A",
birthDate: "2017-08-01"
},
{
user: "B",
birthDate: "2017-08-02"
},
{
user: "C",
birthDate:…

Codeblooded Saiyan
- 1,457
- 4
- 28
- 54
-1
votes
1 answer
DatePipe transform shows wrong date format
I am using Angular version 12 and datePipe.transform, I am getting date in dd/MM/yyyy format in string and I want to bind that date in my reactive form ( to edit the form ) where I use Angular material date picker Basic Angular Date picker
Demo
I am…

Raj
- 15
- 8
-1
votes
1 answer
date function in angular - I want to increment the date by 7 and display in html
i have a date in this format from API 31-08-2021 13:58
I want to show this date in one mat-cell and then in another cell
I have to add 7 to it eg: 7-09-2021 13:58 and display this
how to achieve this.

FE-Deve
- 13
- 3
-1
votes
1 answer
Component.html:151 ERROR Error: InvalidPipeArgument: 'Unable to convert “14-05-2021” into a date' for pipe 'DatePipe'
I am getting response from backend LastDate. I am binding this to my ngModel and showing in Grid, but in console I am getting this error
Here is the corresponding code

Rohit Patil
- 79
- 2
- 6
-1
votes
1 answer
How to show time in hour,minute and second format in angular
Date is coming as 00:00:07 but I want to show in UI as 0h 0m 0s.
Is there a way to show like this ?
I tried split function working fine but don't want to use split is there any library available?

Priyanka
- 370
- 1
- 6
- 15
-1
votes
1 answer
How to convert Angular locale date to proper date format for API to consume?
I am using two-way binding in my template driven form:
ts:
searchLeaveApplication: any = {};
html:

Efron A.
- 353
- 3
- 10
- 19
-1
votes
1 answer
he-IL Hebrew locale incorrect date format Angular 4
Using angular 4 date pipe to format dates. For he-IL (Hebrew) locale I see the data format as dd.mm.yyyy instead of dd/mm/yyyy
Not sure why this discrepancy?

hem
- 21
- 3