Questions tagged [date-pipe]

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

119 questions
2
votes
3 answers

Format time in Typescript Angular

I want to iterate time in my FormArray and I'm receiving time from API in the below format: 14.21.00 I want to format this time like this: 2:21 PM I'm trying to format using Angular DatePipe like this: {{summon.value.summonTime | date :'shortTime'…
hafizi hamid
  • 405
  • 2
  • 20
  • 41
2
votes
3 answers

How to format an array of dates using datepipe in angular?

I have an array of dates and it would be like [ "2019-06-17 09:21:20+05:30", "2019-06-18 09:21:20+05:30", "2019-06-19 09:21:20+05:30", "2019-06-20 09:21:20+05:30" ] how to convert this to date time using…
minnu merin alex
  • 87
  • 1
  • 2
  • 9
2
votes
4 answers

How to validate date using DatePipe in Angular 5 app?

I have bsDatepicker with bsConfig and I'm trying to validate it, to make sure it is with the right format. The problem is that bsDatepicker create a date in a different format so I can't validate it. The date string is: Mon Apr 01 2019 19:05:36…
user2304483
  • 1,462
  • 6
  • 28
  • 50
2
votes
2 answers

InvalidPipeArgument: 'Unable to convert "2018-01-01-12:12:12:123456" into a date' for pipe 'DatePipe'

{{suite.testSuiteAttributes && suite.testSuiteAttributes.modifiedTimestamp | date: 'yyyy-MM-dd' }} I want the Date format in "05-Feb-2018 11:00:00 PM CST" CST format.But getting the error: Unable to convert…
sm770
  • 103
  • 1
  • 3
  • 12
2
votes
1 answer

Timezone for date not working in Date pipe - angular 5

I am fetching data from date column in my DB. I try to format it with the timezone using the date pipe. Below is the code Date…
user10192769
  • 119
  • 2
  • 3
  • 12
2
votes
3 answers

Datepipe angular 2 not displaying correct resuts

Below is my code. using angular 2 build in date pipe to convert time stamp to proper date format. import { Component } from '@angular/core'; @Component({ selector: 'my-app', template:`

My First Angular 2 App

{{test | date: 'dd/MM/yyyy'}}…

Ireal
  • 355
  • 4
  • 16
2
votes
1 answer

Why date pipe with input type text does not work with angular2?

This works : DetailEvent is a object which has start_time of type Date {{DetailEvent.start_time | date: 'MMM'}} This does not work:
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
1
vote
1 answer

Format UTC date and time in angular

I am trying to change just the UTC time and date format which I am receiving from backend.I tried datepipe to format the UTC time but it automatically converting the time to my local browser time. I want to show the same time which the backend…
Priya
  • 13
  • 3
1
vote
1 answer

Angular: how to change the default locale translation of certain month name?

We use two locales in our project: russian and kazakh. For displaying dates we use angular's default datePipe. The word June in kazakh is "маусым" and it's shortened version is "мау". The short version confuses some of our users, because it's…
Martes Carry
  • 41
  • 1
  • 4
1
vote
1 answer

Override Angular default date names

The names of months in pt-br LOCALE_ID put a dot when use format MMM, example: "Janeiro" to "jan." How to replace the table of default names?
1
vote
2 answers

Angular HTML: compare string datetime to current datetime

How can I compare "2022-01-07 15:43:00" string variable with current datetime in *ngIf of angular html? Please help and guide.
ganesh
  • 416
  • 1
  • 11
  • 32
1
vote
1 answer

Locale Date Angular 8 unable to convert

In my app.module.ts I added this code: import { NgModule, LOCALE_ID } from '@angular/core'; import it from '@angular/common/locales/it'; import { registerLocaleData } from '@angular/common'; registerLocaleData(it); //inside here I got all the…
LiefLayer
  • 977
  • 1
  • 12
  • 29
1
vote
1 answer

Custom GMT format date pipe in Angular

I'm using angular default date pipe for formatting my date, using this code. {{'27-04-2021 08:30:00' | utcDate | date: 'EE, d MMMM OOOO'}} The result is Tue, 27 April GMT+05:30 I have to show the result as Tue, 27 April GMT+5:30 I have to format the…
1
vote
0 answers

Angular DatePipe incorrect format in server

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:…
1
vote
1 answer

how to append timezone to Datepipe's tranform function?

I want to convert UTC time to specific timezone using angular DatePipe. Without appending timezone, transform method converts UTC to local time which i don't want. here's the code. punch_time = this.datepipe.transform('2021-02-05T06:03:40.574000Z',…
BLU
  • 61
  • 8