Input date format

Posted by: lygiabao15ck1 on 16 September 2019, 3:03 am EST

    • Post Options:
    • Link

    Posted 16 September 2019, 3:03 am EST

    I want format input date like this:

  • Posted 16 September 2019, 3:04 am EST

    like this : 平成29/2017年09月09日

  • Posted 16 September 2019, 4:28 am EST

    Hi,

    You may use the format property of the InputDate control to change the format of the dates:

    date.format =`gggyy/${date.value.getFullYear()}年MM月dd日`
    

    But, when we use ‘ggg’ in the format, all of the years are converted to the era year. So, we will need to update the format on the valueChanged event:

    let date = new wijmo.input.InputDate('#date', {
    	value: new Date(2017, 8, 9),
    	valueChanged: function(s, e) {
    		s.format = `gggyy/${s.value.getFullYear()}年MM月dd日`
    	}
    });
    

    Please refer to the sample attached.

    Regards,

    Ashwin

    InputDate JS.zip

  • Posted 16 September 2019, 6:02 am EST

    Thanks you for best answer

Need extra support?

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

Learn More

Forum Channels