Posted 23 September 2019, 1:50 pm EST
Hello Wijmo team,
I am using wijmo 5 and angular 5 in our project right now.
We are now facing a scenario that we need to support our customer 2 formats of date which are “mm/dd/yyyy” and “mm/dd/yy” when we using wj-input-date component.
Now, I found when we set format=“M/d/yyyy” user couldn’t type in as “1/1/19” or the date will like 1/1/0019. If I set format=“M/d/yy” then user’s input “1/1/2019” will result as 1/1/2020. Is there any way to make these 2 formats working together? I mean using some way like directive. I try to find source functions of this component for writing a directive to change some functions’ behavior to implement our requirement, but I couldn’t find its source code of these functions. Could you help us on this?
I know add a cellEditEnded may works, but that might need to add too many code to change this in our current project and won’t be a good idea for centralize it.
By the way, my current wijmo package is C1Wijmo-Enterprise_5.20172.328.zip and angular version is 5.1.0
and part of the sample code:
<wj-flex-grid-column [header]=“‘Begin Date’” [binding]=“‘beginDate’” [isReadOnly]=“false” [width]=“105” [cssClass]=“‘editAble’” [name]=“‘beginDate’” [dataType]=“‘Date’”>
<ng-template wjFlexGridCellTemplate [cellType]=“‘Cell’” let-cell=“cell”>
<div *ngIf=“cell.item.beginDate”>{{cell.item.beginDate | amUtc | amDateFormat:‘l’ }}
<ng-template wjFlexGridCellTemplate [cellType]=“‘CellEdit’” let-cell=“cell”>
<wj-input-date [(value)]=“cell.item._beginDate” format=“M/d/yyyy” [isRequired]=“false”>
Thank you.
bzhang