Wijmo input date format question

Posted by: bzhang on 23 September 2019, 1:50 pm EST

    • Post Options:
    • Link

    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

  • Posted 24 September 2019, 12:33 am EST

    Hi,

    We were able to replicate the issue in the provided version but this issue does not occur in the latest version when using the date format ‘M/d/yyyy’. Both input formats work with this format of InputDate. You may verify the same using the sample attached. So, I would suggest you upgrade wijmo to the latest build.

    Also, I would suggest you to keep upgrading Wijmo regularly to get all of the fixes and enhancements.

    Let us know if you have any issues while upgrading.

    Regards,

    Ashwin

    inputdate.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels