Title: Date formatting Post by: Pierre on April 14, 2014, 05:57:05 AM Hello all
I have this function (for date formatter filed): Code: ... and this function: Code:
I need this format: 14.04.2014 instead of 04/14/2014 and it does not work. I returns only today's date. How to format datebox correctly so I can have 14.04.2014 displayed? Thank you. Title: Re: Date formatting Post by: stworthy on April 14, 2014, 07:40:39 AM Please try this:
Code: <input class="easyui-datebox" data-options="formatter:myformatter,parser:myparser"></input> Title: Re: Date formatting Post by: Pierre on April 15, 2014, 12:05:11 AM It works perfect, thank you.
Title: Re: Date formatting Post by: Pierre on April 18, 2014, 02:13:43 AM Stworthy
could you please tell me (or someone else) how to use your example to return US date? I use data-options="formatter:myformatter,parser:myparser" for all date fields and when I need European date, your example works OK but when I need US date, I need to somehow return 04/17/2014 instead of 17.04.2014 thanks for any hint. Title: Re: Date formatting Post by: stworthy on April 19, 2014, 02:12:33 AM If you want to use '04/17/2014' format, don't use the custom 'formatter' and 'parser' functions. So <input class="easyui-datebox" data-options="formatter:myformatter,parser:myparser"> will return '04/17/2014' format and <input class="easyui-datebox"> will return the default US format.
Title: Re: Date formatting Post by: Pierre on April 19, 2014, 10:38:31 PM Thank you Stworthy, I understand that, but I meant to keep <input class="easyui-datebox" data-options="formatter:myformatter,parser:myparser"> and to change 'formatter' and 'myparser' (JavaScript) side instead of HTML side (there where I declare them).
It it is not possible, then OK - I would use as you suggested. Thanks. |