Title: [SOLVED: added new functionality] datebox getValue as Date object Post by: Coder on December 26, 2019, 10:37:19 AM How get current value from datebox as Date object ?
my formatter is dateFormat(aDate,"dd mmm HH:MM") and .datebox('getValue') return string in this format ;( Title: Re: datebox getValue as Date object Post by: jarry on December 29, 2019, 07:39:47 PM Please call this code to convert a string to a Date object.
Code: var db = $('#db'); Title: Re: datebox getValue as Date object Post by: Coder on December 31, 2019, 11:32:09 AM Thnx for Your reply, but:
I use my parser for decode mySQL datetime format Code: function parseMySQLdate(aDate){ so it`s not suitable for... and db.datebox('getValue'); return string without year (because my formatter is dateFormat(aDate,"dd mmm HH:MM") ) is there a possibility to store date as Date object in date[time]box inside formatter or inside ('setValue') and get it as Date object from ('getValue') ? OR maybe add .datetimebox('getDate') .datetimebox('setDate',DateObject) ? Title: Re: datebox getValue as Date object Post by: jarry on January 04, 2020, 03:23:54 AM This is the extended method 'getDate'.
Code: $.extend($.fn.datebox.methods, { The live example is available from http://code.reloado.com/oridat4/edit#preview Title: Re: datebox getValue as Date object Post by: Coder on January 07, 2020, 01:43:05 PM Thnx for reply, and very interesting code
but: Code: $('#db').datebox('setValue','2010-11-01 12:30:00') result is Mon Jun 11 2187 00:00:00 if I change parser for mySQL date parse then it didnt work for "dd mmm HH:MM" format. solve for this is use another parserFunction inside getDate method BUT information about year is lost. Does it exist access to datebox object from inside formatter? For example for set $(datebox).prop('Date',date) and extract it from getDate method ( return jq.datebox.prop('Date') ) ? Title: Re: datebox getValue as Date object Post by: jarry on January 09, 2020, 12:40:35 AM This is the extended 'setDate' and 'getDate' methods.
Code: $.extend($.fn.datebox.methods, { Title: Re: datebox getValue as Date object Post by: Coder on January 09, 2020, 04:20:06 AM thnx for road...
may be last question about datebox in this thread ^) How to owerride or add changes to currDate variable when date setted with calendar ? Title: Re: datebox getValue as Date object Post by: jarry on January 10, 2020, 02:46:44 AM The 'getDate' and 'setDate' methods have been included into the newest version. Please download it from the site.
Here is the live example. http://code.reloado.com/atorub3/edit#preview Title: Re: datebox getValue as Date object Post by: Coder on January 10, 2020, 05:08:21 AM YOU ARE WONDERFUL ! ::) ::) ::)
|