“Przykład Centralny stref czasu daty JavaScript Rip” Kod odpowiedzi

Przykład Centralny stref czasu daty JavaScript Rip

<!--output '2015-06-15 05:03 PM GMT+9'-->
    <p>The custom date is {{today | date:'yyyy-MM-dd HH:mm a z':'+0900'}</p>
Flynn

Przykład Centralny stref czasu daty JavaScript Rip

import { Pipe, PipeTransform } from '@angular/core';import { DatePipe } from '@angular/common';import * as moment from 'moment-timezone';/*** A moment timezone pipe to support parsing based on time zone abbreviations* covers all cases of offset variation due to daylight saving.** Same API as DatePipe with additional timezone abbreviation support* Official date pipe dropped support for abbreviations names from Angular V5*/@Pipe({  name: 'momentDate'})export class MomentDatePipe extends DatePipe implements PipeTransform {transform(  value: string | Date,  format: string = 'mediumDate',   timezone: string = 'Europe/Prague'): string {  const timezoneOffset = moment(value).tz(timezone).format('Z');  return super.transform(value, format, timezoneOffset);  }}
Flynn

Odpowiedzi podobne do “Przykład Centralny stref czasu daty JavaScript Rip”

Pytania podobne do “Przykład Centralny stref czasu daty JavaScript Rip”

Więcej pokrewnych odpowiedzi na “Przykład Centralny stref czasu daty JavaScript Rip” w JavaScript

Przeglądaj popularne odpowiedzi na kod według języka

Przeglądaj inne języki kodu