News:

Join the Facebook Fan Page.

Main Menu

Calendar UK

Started by smitch6, May 04, 2012, 05:17:24 AM

Previous topic - Next topic

smitch6

I have the calendar in my simple portal showing on my site.
the trouble is all the holidays are for the USA and i'm in the UK


i know they can be edited manually but is there a plug-in that sorts all the dates out?
i have posted on simple portal website but got told because the calendar is actually an smf thing i'd be better posting on here.......

thanks
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

kat

If you go to Admin>Calendar>Manage Holidays I think everything will become clear. ;)

smitch6

i've looked there........
i can see all the holdiays listed as i said in my 1st post.
i wondered if there was an easier way rather than deleting everything and inserting my own each year that will take ages
Friendly, reliable web hosting at affordable prices
www.normanboatforum.co.uk l www.PatTesterSuffolk.co.uk

kat

Sadly, I doubt it.

It'd be brilliant if that could be something that was done, automatically, when your forum's default language was selected, don't you think?

I'll suggest it, in the "Feature requests" board and we'll see what everyone says, ay?

<Edited to add a link to said post.> http://www.simplemachines.org/community/index.php?topic=475871.msg3327395#msg3327395

Kindred

Grudge wrote a holiday import/export mod....

I included it along with the recurring events.... But never updated it for 2.0.
Someone had it for a little while, but then had issues and dropped off....   
You could take a look at what grudge did, originally, if you don't want the rest of it. It was fairly simple - read in or out as a text file, listing the holiday names and dates.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

MrPhil

What you could do is go into the file install_2-0_mysql.sql and snip out the sections for INSERT INTO {$db_prefix}calendar_holidays into MyHolidays.sql. There are two sections: more or less worldwide holidays, and American holidays. Change {$db_prefix} to your prefix (default: smf_). Edit to remove American holidays and insert British holidays (Guy Fawkes Day, Queen's Birthday, etc.). Go into phpMyAdmin and EMPTY the <prefix>calendar_holidays table. IMPORT MyHolidays.sql (your revised holiday list) into the database.

Of course, this requires that you manually set up the list of holidays appropriate for your country. Perhaps the holiday list could be kept separate, as part of the language installation, although that wouldn't help that much if you have members on both sides of the Pond. The ultimate fix would be as K@ suggested to add some sort of country code for each member, and have that country code in the database so that the appropriate holidays could be pulled up.

OCJ

If it was automatic then someone would have to keep it up to date as holidays do change each year in many countries... or a source where they are all available!
Manual isnt that bad.

MrPhil

If it's not a fixed month and day (as well as Common Era calendar; not religious calendars), SMF cannot figure it out. You'll see that floating date holidays are simply listed year by year for many years out. Perhaps something could be done in the style of an advanced "cron" (Memorial Day = last Monday in May = 5,Mon/L, or Election Day = day after first Monday in November = 11,1+Mon/1). I hate to think of how complicated Easter and related holidays would be! That would probably require a dedicated function.

It would not be hard to build a little utility to build the SQL for your country's holidays, and every few years either manually or on a cron job empty out the old calendar table and import the new holidays. A PHP utility could even directly connect to the database and remove past calendar table rows and add new ones. I will leave the raw list of available holidays to some other source.

Advertisement: