e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
321 stars 213 forks source link

Datepicker doubles up entry of year #133

Closed e107steved closed 11 years ago

e107steved commented 11 years ago

Select a date using the datetimepicker (e.g. in event calendar), and the year is entered twice:

e.g. '20132013-03-04' or '18-03-20132013'

dependent on selected display format (Seems to only be a problem with 100% numeric formats). Fixed by changing line 113 of date_handler.php back to 'yy' - but then formats using words for month or day show year as 2 digits, which was the reason line 113 was changed in the first place!

Looks as if it might be a bug in the jquery code.

CaMer0n commented 11 years ago

Could be related to the pref presets in the drop-down menu

STR82U commented 11 years ago

He saw that in the calendar plugin I'm sure. Mine are doubling the year too but only in that plugin, news and other datepickers are fine.

e107steved commented 11 years ago

Absolutely right. I've had a play as well, and can't see where the problem lies. Only clue is that 'add event' operates in userLand (which is OK) while the other instances (which appear to be wrong) are in adminLand. Operates incorrectly in mailout as well.

CaMer0n commented 11 years ago

@e107steved - Here's my test code. Something very strange happening in the JS - but I haven't found any mention of it online.

https://gist.github.com/CaMer0n/5094691

CaMer0n commented 11 years ago

e107_datepicker_issue

e107steved commented 11 years ago

Definitely something to do with the difference between user and admin - I've just taken your test code, wrapped it in the two sorts of header and footer, and it misbehaves in admin mode.

CaMer0n commented 11 years ago

This screenshot is from the front-end. So both must have a problem.

e107steved commented 11 years ago

Your screenshot looks right to me. Using the latest code, this is what I get in the front end: Front_end

..and this is what I get if I create an 'admin' page:

admin_mode

CaMer0n commented 11 years ago

Interesting! Please note that on my front-end, 4 of the items return December dates instead of April. What theme are you using on your front-end? I was using bootstrap.

e107steved commented 11 years ago

I'd missed your December dates - I was focussing on the year display!

Here's my test code: https://gist.github.com/e107steved/5102910 https://gist.github.com/e107steved/5102927

I got some March dates, but on the admin side.

I'm using Bootstrap, pretty much set to defaults.

Just to be clear, in my installation, line 113 of date_handler.php says:

        '%Y'    => 'yy',    // jquery-ui docs say 'yy' but yy produces '13' instead of '2013'
STR82U commented 11 years ago

This was solved for all areas? Calendar and Mailout datepickers don't double up anymore; Calendar is a 4 digit year, the Mailout datepicker is a 2 digit year.

CaMer0n commented 11 years ago

There are still issues.. see: https://github.com/eternicode/bootstrap-datepicker/issues/392

CaMer0n commented 11 years ago

Still as Issue? @Moc, @STR82U

Moc commented 11 years ago

I checked the banner plugin and I cannot see any issues. No more buggy behaviour as far as I can see.

STR82U commented 11 years ago

Seems good here