2016-12-23 44 views
0

我在離子日期時間顯示格式有問題。我不知道爲什麼離子2會削減一年中的最後兩個字符。離子2日期時間顯示錯誤的年份

我有代碼:

<ion-datetime displayFormat="MMM DD, YYYY" [(ngModel)]="form.dateOfBirth" name="dateOfBirth"></ion-datetime> 

而結果是: enter image description here

它與柱寬的問題。我如何覆蓋這個大小?

回答

-1
You can try this code it's works for me hope it will help you. 

date.html

<ion-list> 
     <ion-item > 
      <ion-label class="capitalize">Date</ion-label> 
      <ion-datetime displayFormat="MMM DD YYYY"[(ngModel)]="dateData" (ionChange)="dateChanged()"></ion-datetime> 
     </ion-item> 
    </ion-list> 

showDate.ts

import { Component } from '@angular/core'; 
@Component({ 
    selector: 'date', 
    templateUrl: 'date.html' 
}) 
export class Date { 
     dateData: string; 
    constructor() { } 
    dateChanged() { 
     console.log(this.dateData) 
} 
} 
+0

感謝但沒有工作... – Algeroth

+0

這是這個列的寬度 – Algeroth

0
.picker-col{ 
//here write your custom style to increase width 
min-width:64px 
} 
+0

當我mannualy編輯這個值在螢火蟲,然後它的工作,但是當我把它放在scss文件,然後這個值不會被overrided。 – Algeroth

+0

同樣適用於我,當我放入scss文件時不工作 – big

0

對於離子2 我通過添加以下到variables.scss兩個IOS想出溶液和android

$picker-md-column-padding: 0 0px !default; 
$picker-ios-column-padding: 0 0px !default; 
相關問題