Questions tagged [date-pipe]

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

119 questions
1
vote
3 answers

Angular date pipe takes into account timezone

I'm using a date pipe to display a time that I obtain from a webservice API. The date comes in the form yyyy-MM-ddThh:mm:ss.000Z an example of which would be 2020-08-12T07:06:07.000Z. However when I use the angular date pipe {{ arr.time |…
Nooh Ahamad
  • 353
  • 10
  • 23
1
vote
1 answer

Angular date pipe

I am using Angular 8 date Pipe and manually set the LOCAL to 'en-GB'. But the output of the date pipe still is in the US format (mm/dd/yyyy). Any idea what's the issue? or Am I missing something? const datePipe = new DatePipe('en-GB'); return…
Sripter
  • 21
  • 4
1
vote
1 answer

How to convert a date string to timezone specific date.?

Hi I am having an angular 5 project. I have issues with displaying dates based on the users timezone. Here is my sample snippet of code. formatDateForTableDisplay(dateValueAsString: string) { console.log(dateValueAsString); // this will print…
1
vote
1 answer

Date pipe : LOCALE_ID does not affect the timezone?

In my app I sometimes display date and time like : {{ object.dateStart | date:'shortDate' }} : {{ object.dateStart | date:'HH:mm' }} In my app.module I do have : import localeFr from '@angular/common/locales/fr'; registerLocaleData(localeFr,…
Lempkin
  • 1,458
  • 2
  • 26
  • 49
1
vote
1 answer

Can I format a timezone without the offset using Angular's date pipe?

I'm currently formatting a date in my component using the date pipe: this.datePipe.transform(myDate, 'M/d/yy H:mm z'); The resulting output looks like this: 2/6/20 11:59 GMT-5 Is there a way to format the date like this: 2/6/20 11:59 GMT without…
ChekTek
  • 175
  • 2
  • 10
1
vote
1 answer

How can date and timestamp be shown in Angular using Ngrx and Reactive Form

I have complex graph and I want to create a reactive with form builder and pass the object in form builder this.objectForm = this.formBuilder.group({ ...this.object }); I received the date from back-end in UTC…
1
vote
2 answers

Date pipe in Angular formControlName

Can someone please guide me to implement date pipe in angular 8 with formControlName train.component.html
user1993412
  • 802
  • 2
  • 15
  • 29
1
vote
2 answers

Angular Date pipe month value wrong

I have the following code in my template:
{{createdOn | date:'yyyy-mm-dd'}}
The value of createdOn is 1565762489936 in milliseconds. In terms of date it is 'Wed 14 August 2019'. Instead I get '2019-31-14'. The month value is wrong. Whats…
Mandroid
  • 6,200
  • 12
  • 64
  • 134
1
vote
2 answers

Why I import `Common` module still can't use DatePipe in Angular 7?

In my opinion, if A.module import B.module and B.module import C.module, it stand that A.module import C.module. That's the reason why many Angular developers build a public module named Shared.module. However, this rule looks like doesn't apply to…
Eve-Sama
  • 2,176
  • 4
  • 20
  • 32
1
vote
1 answer

date as string and timezone

I'm having trouble to understand how dates shows as string works. I have this from my database, it is an string: "01/10/2018 11:25:12" in "DD/MM/YYYY HH:mm:ss" format, as far as I can understand it should be in UTC, so, when I translate it to my…
cucuru
  • 3,456
  • 8
  • 40
  • 74
1
vote
1 answer

week number of the year by a given date

I got the date as follow const today = new Date(); now I need to get the week number of the year. How do I get it on the typescript? I tried const todayFormated = this.datepipe.transform(today, 'W'); but it is returning the week number of the…
nifCody
  • 2,394
  • 3
  • 34
  • 54
1
vote
2 answers

DatePipe.transform show InvalidPipeArgument for 'dd-MM-yyyy'

Recently Angular DatePipe is showing an InvalidPipeArgument error but the String date seams to be correct. Can any one see some error? this is my code using Typescript and Angular 6 let datePipe: DatePipe = new DatePipe("es-ES"); let dia_sele:…
exequielc
  • 681
  • 1
  • 11
  • 32
1
vote
2 answers

Angular 6 using 'h' as time separator

Is there any built-in easy way to use 'h' as hours/minutes separator? I am trying to do something like this "12h45" as per: https://en.wikipedia.org/wiki/Date_and_time_notation_in_France For other countries it is quite easy e.g. import { Pipe,…
Nenad Bulatović
  • 7,238
  • 14
  • 83
  • 113
1
vote
2 answers

Wrong Safari date using Typescript Angular 4

I have read many questions related to this issue. However, most solutions included adding third party libraries and I really would like to keep this simple, if possible. Basically, I'm using Angular 4 and trying to display the date in a nice way to…
Lucas Arruda
  • 533
  • 1
  • 8
  • 15
1
vote
1 answer

How to set date format, timezone and locale using angular 4 date pipe?

I have date value from postgres db without timezone. I want this display in angular 2 template with timezone and locale postgres db value : 2017-11-14 09:40:59.753 I just displayed date in angular template using {{codeset.created_on}} it will be…
Chandru
  • 10,864
  • 6
  • 38
  • 53