dubrox / Multiple-Dates-Picker-for-jQuery-UI

MDP is a little plugin that enables jQuery UI calendar to manage multiple dates.
https://dubrox.github.io/Multiple-Dates-Picker-for-jQuery-UI
273 stars 159 forks source link

How to set custom separate on input field (default separate: ","). #55

Closed satels closed 10 years ago

satels commented 11 years ago

Example: 2012-01-01,2012-01-04,2012-01-10 (no beatiful)

How to set ", " ?

Example: 2012-01-01, 2013-02-28, 2013-03-08 (beatiful)!

ghost commented 11 years ago

Unfortunately, it doesn't look like this can be done. I've tried editing the output to the field with a space after the comma, but it looks like it has something to do with how the input field is formatted to not allow spaces. I suggest you use an altField such as a div or span so that you can format it as needed.

technokid commented 11 years ago

find this in code: getDates : function( format, type ) { if(!format) format = 'string'; if(!type) type = 'picked'; switch (format) { case 'object': return this.multiDatesPicker.dates[type]; case 'string': case 'number': var o_dates = new Array(); for(var i in this.multiDatesPicker.dates[type]) o_dates.push( dateConvert.call( this, this.multiDatesPicker.dates[type][i], format ) ); return o_dates; default: $.error('Format "'+format+'" not supported!'); } },

and add to "return o_dates;" ".join(" , ")" the end result should get this kind of "return o_dates.join(" , ");"

dubrox commented 10 years ago

I don't remember when, but it was fixed and works in the current version of mdp.

dubrox commented 10 years ago

You should use the option:

{
      separator: ", "
 }