Title: Initialize datebox with blank and format data as dd-mm-yyyy (British format) Post by: thecyberzone on February 19, 2015, 09:53:28 AM Although there were so many threads exist in this forum with this discussion, just I am adding a small request to the developer. To use a databox with dd-mm-yyyy format just I have used following parser and formatter, everything is working fine except whenever a blank date is parsed/formatted within this datebox it always puts current date, (It should be, as per my code it is initialized with new Date), but what I require is to initialized with a blank date. The code I have used is :
Code: $.fn.datebox.defaults.formatter = function(date){ Now what I have done in above code, in parser instead of returning simple new Date() I have used new Date(0,0,0) and in formatter function I have check that Code: if(date==Date(0,0,0)) {return ' ';} So please anybody suggest me a way by which I can display a blank date in datebox when it is empty/blank. Title: Re: Initialize datebox with blank and format data as dd-mm-yyyy (British format) Post by: stworthy on February 20, 2015, 06:13:23 AM The date 'new Date(0,0,0)' is not a blank date. Please try to use 'null' value instead. To let the 'parser' function work correctly, the calendar's 'moveTo' method should also be overridden.
Code: $.extend($.fn.calendar.methods, { Title: Re: Initialize datebox with blank and format data as dd-mm-yyyy (British format) Post by: thecyberzone on February 20, 2015, 09:19:16 AM Thanks for your help, after adding moveTo method to the Calender, it works perfectly as I wanted.
|