Closed moollaza closed 8 years ago
Can I try working on this?
@iambibhas yes, please do!
@moollaza for holidays that span multiple days, they dont seem to be returning a start date and end date, just the text to display -
ddg_spice_time_and_date_holiday(
{
"c": null,
"q": "kwanzaa",
"h":
[
{
"d":
[
"Saturday, December 26, 2015"
],
"n": "Kwanzaa (until Jan 1)",
"u": "/holidays/us/kwanzaa",
"a": "Kwanzaa is a week-long holiday honoring African culture and traditions. It falls between December 26 and January 1 each year. Maulana Karenga, an African-American leader, proposed this observance and it was first celebrated between December 1966 and January 1967.",
"p": "https://c.tadst.com/gfx/300h/kwanzaa-usa.jpg?1"
}
]
}
)
Is it possible to ask them to return a saner formatted data?
they dont seem to be returning a start date and end date, just the text to display
@iambibhas Good catch, I'll see if they can improve the API for us. For now we might have to parse out the end day (which sucks).
@moollaza can you give me example of couple of more holidays that span for multiple days? I'm not familiar with many holidays in US. It returns just the first date for Hanukkah.
@moollaza once it's public, is it possible to trigger this via some kind of deep triggering when someone searches for a holiday even without the "when is" phrase? Like if someone searches for "good friday".
@iambibhas yup we can add that internally if needed.
Also, T&D got back to us, there are more holidays (mostly Chinese) that will have the end date in the title. There's nothing they can do to fix that for now, so we should probably use a regex to pull it out when applicable.
They're looking into indicating which countries/regions apply to the different start dates they give us (for now it's explained in the description text)
So should I work on extracting the date out of the title? It sounds really messy, and TBH, it doesn't look all that bad as it is right now. I can work on it if we really need it.
So should I work on extracting the date out of the title?
@iambibhas I think it should be fairly simple? A regex that looks for content inside a pair of ()
in the title should suffice.
It's simple, but I've got only one test case. None of the chinese holidays have an end date yet - https://www.timeanddate.com/holidays/china/. I have to do it assuming that the format would be same always. Hence, something like this will probably break the parsing https://www.timeanddate.com/holidays/brazil/carnival-end
@iambibhas good point -- looks like the mix in other info into the parens. I guess we can leave it for now, but I have a feeling the design team won't love it ;)
Also, like for Kwanzaa, the title is Kwanzaa (until Jan 1)
. There is no year mentioned. Have to assume that the year is the next year if the rest of the date is older than today, else the year is this year.
It's simple yet messy.
I hope the T&D people realize that providing the end date separately is a really important step.
The awesome team at TimeAndDate had started a Spice Instant Answer that allows for us to search for upcoming Holidays.
I've pushed the code to a branch, timeanddate/holidays and we now need someone awesome to finish up the integration. They've done a good job but we'd like to simplify the IA and use more features of our built-in templates.
More specifically, we'd like this to be done:
text
template grouptitle
(the date of the Holiday),subtitle
(name of the holiday) anddescription
For Holidays that span multiple days, we can use the same view, and update the title to show the date range:
For Holidays/searches with multiple days (like "when is Eid") let's show a tile view (we may need to increase the tile width to display the title, subtitle and description better):
FWIW, this Instant Answer will eventually evolve to use a special Calendar View that we're working on. Then we'll be able to show multiple holidays in a much easier to use interface. Ideally clicking on a holiday would expand to provide more information about it. For now a simplified text view should be good enough!