Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove int typehint #5763

Closed
wants to merge 5 commits into from
Closed

Remove int typehint #5763

wants to merge 5 commits into from

Conversation

wilsonge
Copy link
Contributor

This was intially checking a null date until @Bakual 's changes. However now there is no reason for it. This can cause bugs when you don't have a fully integer date (e.g. display a month in full which is perfectly compatible with strtotime() http://php.net/manual/en/datetime.formats.date.php)

To test check the calendar still works as expected

If you want to go the extra mile you can add a format like %B %Y into the calendar. This will save correctly but not render. Apply patch and it should be fixed.

@@ -177,7 +177,7 @@ protected function getInput()
{
case 'SERVER_UTC':
// Convert a date to UTC based on the server timezone.
if ((int) $this->value && $this->value != JFactory::getDbo()->getNullDate())
if (!is_null($value) && $this->value != JFactory::getDbo()->getNullDate())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use $this->value and it should work :)
Same a few lines later.

@zero-24
Copy link
Contributor

zero-24 commented Jan 16, 2015

@wilsonge

travis is not happy with that change see:


There was 1 error:
1) JFormFieldCalendarTest::testGetInput
Exception: DateTime::__construct(): Failed to parse time string (value) at position 0 (v): The timezone could not be found in the database
/home/travis/build/joomla/joomla-cms/libraries/joomla/date/date.php:106
/home/travis/build/joomla/joomla-cms/libraries/joomla/factory.php:530
/home/travis/build/joomla/joomla-cms/libraries/joomla/form/fields/calendar.php:197
/home/travis/build/joomla/joomla-cms/libraries/joomla/form/field.php:393
/home/travis/build/joomla/joomla-cms/libraries/joomla/form/fields/calendar.php:73
/home/travis/build/joomla/joomla-cms/tests/unit/suites/libraries/joomla/form/fields/JFormFieldCalendarTest.php:523

FAILURES!                                                              
Tests: 5700, Assertions: 10446, Errors: 1, Incomplete: 9, Skipped: 127.
`` `
https://travis-ci.org/joomla/joomla-cms/jobs/47277702<hr /><sub>This comment was created with the <a href="https://github.com/joomla/jissues">J!Tracker Application</a> at <a href="http://issues.joomla.org/tracker/joomla-cms/5763">issues.joomla.org/joomla-cms/5763</a>.</sub>

@wilsonge wilsonge closed this Feb 3, 2015
@wilsonge wilsonge deleted the date branch February 3, 2015 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants