midhundevasia / typo3-blogmaster

Blogmaster - Blog system for TYPO3 CMS. A simple extension to create blog in TYPO3. The extension is available on TER, you can install it from TYPO3 ExtensionManager or via composer. (EXT:blogmaster)
GNU General Public License v3.0
4 stars 0 forks source link

Bug in Date Dropdown #4

Open HorstBaumann opened 7 years ago

HorstBaumann commented 7 years ago

there's a little bug in the new added Date-Editing-Section. The DropDown lists 12 entries (months) - but always followed by a "Jan". After selecting one enty (e.g. 9 > September) and click on OK - it is stored as January... 2016-12-04_12h08_22

is it possible to use the TYPO3 own Dateselector ? 2016-12-04_12h15_38

midhundevasia commented 7 years ago

which PHP and TYPO3 version you are using?

here is settings the month name, i don't actually understand why those entries shows wrong values. https://github.com/midhundevasia/typo3-blogmaster/blob/master/Classes/Controller/PostController.php#L123

anyway let me inspect that whether it reproducible.

HorstBaumann commented 7 years ago

PHP 5.5.28 TYPO3 7.6.12

midhundevasia commented 7 years ago

I made a test on PHP 5.5 and TYPO3 7.6.12 its working fine. I think you forget to add the locale settings there in TypoScript.

locale = de_DE https://github.com/midhundevasia/typo3-blogmaster/wiki/TypoScript-Settings#locale--locale

timezone = Europe/Berlin https://github.com/midhundevasia/typo3-blogmaster/wiki/TypoScript-Settings#timezone--timezone-for-php-and-javascript

midhundevasia commented 7 years ago

please report if this still exists.

HorstBaumann commented 7 years ago

yes, it still exists. But I was able to locate it ;-) "Classes/Controller/PostController.php" Line: 123 $monthName[$i] = strftime($i . ' %b', strtotime('20-' . $i . '-1900')); seems to create the Problem I changed it to: $monthName[$i] = strftime($i . ' %b', mktime(0,0,0,$i, 1, date('Y')));

and because the doubling of month_number + month_name is a littel confusing, I've shortened it to: $monthName[$i] = strftime('%b', mktime(0,0,0,$i, 1, date('Y')));

HorstBaumann commented 7 years ago

the only problem now is: months with special letters ("Mar" >in german "Mär") does not appear (but is selectable) and another phenomenon: after selecting - the Month appears as "undefined", but after pressing the Update button - everything is fine ;-) 2016-12-13_01h49_17

midhundevasia commented 7 years ago

Am using a split function to extract the month name from the selected option text, so while removing that month_number the function do not return the month_name ;)

https://github.com/midhundevasia/typo3-blogmaster/blob/master/Resources/Private/Partials/Post/Sidebar/PostStatus.html#L99

midhundevasia commented 7 years ago

will fix that month name error on the next release 1.0.7