This is a reverse lookup of events/holidays. When a name is passed in, it should return an array of Carbon dates for the given event/holiday name. The reason for the array value is that, there are some events that have the same name, but have been proposed by different sponsors. In this case, both dates would be returned in the array.
For instance, if the method OnThisDay::whenIs('Halloween') is run during 2016, the return value would be [Carbon '10/31/2016'].
Another instance, if the method OnThisDay::whenIs('Thanksgiving', '2012') is run, the return value would be [Carbon '11/22/2012'].
Requirements:
- Use the supplied method signature in the OnThisDay class.
- The first argument (event name) should not be case sensitive.
- The second argument, if provided should allow for a 2 or 4 digit year
- The second argument, if not provided should default to the current year
- The return value would be an array of Carbon dates
- Unit tests have already been written: the test_when_is_event() method. These tests should pass.
This is a reverse lookup of events/holidays. When a name is passed in, it should return an array of Carbon dates for the given event/holiday name. The reason for the array value is that, there are some events that have the same name, but have been proposed by different sponsors. In this case, both dates would be returned in the array.
For instance, if the method OnThisDay::whenIs('Halloween') is run during 2016, the return value would be [Carbon '10/31/2016'].
Another instance, if the method OnThisDay::whenIs('Thanksgiving', '2012') is run, the return value would be [Carbon '11/22/2012'].
Requirements: