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

Wrong today's date. #6

Closed
aavrug opened this issue Sep 19, 2016 · 4 comments
Closed

Wrong today's date. #6

aavrug opened this issue Sep 19, 2016 · 4 comments

Comments

@aavrug
Copy link

aavrug commented Sep 19, 2016

I am displaying this month's calendar but 01-09-2016 is selected by default instead of today's date.
$calendar = new \donatj\SimpleCalendar('September '.$currentYear);
$calendars['month'] = $monthName;
$calendars['calendar'] = $calendar;
$calendars['calendar']->show();

@donatj
Copy link
Owner

donatj commented Sep 20, 2016

The following outputs correctly for me. How about you?

$calendar = new \donatj\SimpleCalendar();
$calendar->setDate('September 2016');
$calendar->show(true);

screen shot 2016-09-20 at 5 23 08 pm

There's very little to the setDate parsing. The method setDate simply calls getdate(strtotime($date_string))

If you execute var_export(getdate(strtotime('September 2016'))); do you get the following?

array (
  'seconds' => 0,
  'minutes' => 0,
  'hours' => 0,
  'mday' => 1,
  'wday' => 4,
  'mon' => 9,
  'year' => 2016,
  'yday' => 244,
  'weekday' => 'Thursday',
  'month' => 'September',
  0 => 1472680800,
)

@aavrug
Copy link
Author

aavrug commented Sep 21, 2016

Yea I am also getting same output like your's but you have also default date selected is 1. Does this means In this plugin I cannot show today's date selected by default?

@ben182 ben182 mentioned this issue Mar 17, 2017
@donatj donatj closed this as completed Jul 8, 2019
@donatj donatj reopened this Jul 8, 2019
@donatj
Copy link
Owner

donatj commented Jul 8, 2019

Oops, didn't mean to close that ;)

@donatj donatj closed this as completed Nov 18, 2019
@donatj
Copy link
Owner

donatj commented Nov 18, 2019

Fixed in #12

This issue was closed.
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

No branches or pull requests

2 participants