jquery-calendrical icon indicating copy to clipboard operation
jquery-calendrical copied to clipboard

Call to formatDate has wrong parameters for usa format option

Open ozzierod opened this issue 12 years ago • 1 comments

When including the option for usa date format, the date range seems to break on the end date. This is do to the fact that the plugin is calling formatDate on line 382 with the wrong parameters.

This:

                          if (endDate >= selected) {
                                options.endDate.val(formatDate(
                                    new Date(
                                        date.getTime() +
                                        endDate.getTime() -
                                        selected.getTime()
                                    ),
                                    options.usa,
                                    options.separator
                                ));
                            }

Should be:

                            if (endDate >= selected) {
                                options.endDate.val(formatDate(
                                    new Date(
                                        date.getTime() +
                                        endDate.getTime() -
                                        selected.getTime()
                                    ),
                                    options
                                ));
                            }

ozzierod avatar May 21 '12 23:05 ozzierod

I have this fixed my fork, and submitted pull request #21, but so far the maintainer hasn't pulled in the changes.

dnd avatar May 22 '12 04:05 dnd