angular2-moment

Template parse: The pipe could not be found

余生长醉 提交于 2020-01-13 19:00:27
问题 I am getting the error: Template parse errors: The pipe 'amDateFormat' could not be found Here is my app.module.ts import { NgModule } from '@angular/core'; ... import { MomentModule } from 'angular2-moment'; ... @NgModule({ declarations: [ MyApp ], imports: [ ... MomentModule, ... ], bootstrap: [IonicApp], entryComponents: [ MyApp ], providers: [ ... ] }) export class AppModule { } Then in service-booking-details.ts I am doing the following: import { Component} from '@angular/core'; import {

Moment js interval for a day in 12 hours format

谁说胖子不能爱 提交于 2019-12-24 01:12:59
问题 In 12 hours format,i have to create a interval of 15 minutes in moment which is working fine with 30 minutes interval. var hours = []; for (let hour = 0; hour < 24; hour++) { hours.push(moment({ hour }).format('h:mm a')); hours.push( moment({ hour, minute: 30 }).format('h:mm a') ); } console.log( hours); But when work with 15 minutes shows the wrong format.can anone help? var hours = []; for (let hour = 0; hour < 24; hour++) { hours.push(moment({ hour }).format('h:mm a')); hours.push( moment(

Template parse: The pipe could not be found

半城伤御伤魂 提交于 2019-12-06 11:22:20
I am getting the error: Template parse errors: The pipe 'amDateFormat' could not be found Here is my app.module.ts import { NgModule } from '@angular/core'; ... import { MomentModule } from 'angular2-moment'; ... @NgModule({ declarations: [ MyApp ], imports: [ ... MomentModule, ... ], bootstrap: [IonicApp], entryComponents: [ MyApp ], providers: [ ... ] }) export class AppModule { } Then in service-booking-details.ts I am doing the following: import { Component} from '@angular/core'; import { IonicPage, NavController, NavParams} from 'ionic-angular'; import { MomentModule } from 'angular2