Topic: Make daylight saving a global option

I'd like to set the daylight saving option globally and use this setting as default for user registration.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Make daylight saving a global option

Not going to happen in the core, since DST is not a global thing. It's a personal setting that depends on where the person is in the world and when it is.

Re: Make daylight saving a global option

But the global board time is also set as default when registering. Isn't this also a personal setting?

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Make daylight saving a global option

Furthermore it makes sense that a board runs with the same time (daylight saving included) as the region it is intended for.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Make daylight saving a global option

Touché wink
You're right, with the ability to set the default timezone for guests there needs to be the ability to toggle DST on/off to keep times in sync. The way you presented it originally made me think only of the affect on new registrations, not of the impact on guests and the board as a whole.

Re: Make daylight saving a global option

smile

Someone could write an extension for automatic DST switching and another one for time, DST and language preselection based on the browserinformation... wink

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Make daylight saving a global option

Is my proposal going to be incorporated or do you want me to write a patch first? tongue

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Make daylight saving a global option

I'll add it at some point, but I'm quite busy atm

Re: Make daylight saving a global option

Thanks for clarification.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Make daylight saving a global option

Done in 575.

Ben
SVN repository for my extensions - The thread
Quickmarks 0.5
“Question: How does a large software project get to be one year late? Answer: One day at a time!” - Fred Brooks

Re: Make daylight saving a global option

The patch I supplied didn't solve the primary problem. Here's a patch that uses the forum dst as default value in the registration process:

File: /register.php

Add below line 467:

$select_dst = isset($_POST['dst']) ? $_POST['dst'] : $forum_config['o_default_dst'];

Replace line 471 with:

<span class="fld-input"><input type="checkbox" id="fld<?php echo ++$forum_page['fld_count'] ?>" name="dst" <?php $select_dst ? 'checked="checked" ' : '') ?>/></span>
http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Make daylight saving a global option

That doesn't make sense. Why use the forum DST as the default? If the user doesn't check the DST box, then they don't want to observe DST regardless of what the forum is doing.

Re: Make daylight saving a global option

In the registration process the forum setting is used for the timezone, so why shouldn't it be used for DST?

I can't imagine a situation where someone living in a country with DST doesn't want to use it.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Make daylight saving a global option

Christian wrote:

In the registration process the forum setting is used for the timezone, so why shouldn't it be used for DST?

Because if $_POST['timezone'] is not set then it means the user is looking at a new form which should include the default values.
For $_POST['dst'] this is not the case, if it isn't set the user either has left the box unticked OR is looking at a new form. Changing the users selection to the default after they have selected something is worse than the initial "default" not matching the boards default.

I am fairly sure Smartys was referring to the fix not making sense, rather than the idea. Granted it shouldn't be hard to fix properly.

Edit: Okay should be done in r703.

Last edited by Reines (2008-09-24 17:31:15)

Re: Make daylight saving a global option

I actually misinterpreted the code: in just glancing at it, I thought it was being used to determine whether or not to enable DST when the form was submitted. But Reines noticed the actual problem which my post coincidentally happened to allude to.

Re: Make daylight saving a global option

Thanks.

http://www.fluxbb.de - Deutschsprachiges FluxBB Supportforum

Re: Make daylight saving a global option

I'm currently using punbb and noticing that people in some countries currently get the wrong time because the US is still in summer time but the UK is now in winter time

Would it not make more sense to adjust the time according to the clock of the local PC with client side javascript - so it would output something like

Post_time=now()-1.23 hours

and the browser would display the relevant time without all the users having to select a timezone at all.

It seems kind of poor to me that we force everyone to select a timezone but then still get it wrong for a couple of weeks every year because different countries switch DST on different days - this patch is an improvement but surely its something that can be automated.

Also I think that asking the time is not really a good first impression to have on the user signup page, it just makes me think WTF this system can't even figure out what time it is! (you could at least get it to default to something sensible)

This would also have the bonus effect that users who are not signed in would also see the correct times.

I appreciate that fluxBB is supposed to be lightweight but surely this would not need that much CPU?

Re: Make daylight saving a global option

Also I think having the tickbox called 'daylight savings' is a bit confusing, that is asking the user to state 'YES my country uses DST so you can adjust times in the summer when required'.

What it actually means is "you are going to have to visit this settings page twice a year and toggle this setting"

If it has to be a manual process then maybe the wording on the tickbox should just read: "Adjust times by 1 hour"

Re: Make daylight saving a global option

Adjust for DST: Daylight savings is in effect (advance times by 1 hour)
That is what it says

Re: Make daylight saving a global option

Erm, Lanark, it's a profile setting. The global setting is there as a default and for guests.

Ben
SVN repository for my extensions - The thread
Quickmarks 0.5
“Question: How does a large software project get to be one year late? Answer: One day at a time!” - Fred Brooks

Re: Make daylight saving a global option

elbekko wrote:

Erm, Lanark, it's a profile setting.

yes I think thats the problem - the user is running a machine presumably with a clock and time saving set the way they like, why cant the board just read that automatically.

elbekko wrote:

The global setting is there as a default and for guests.

when the guests are in different countries there is no 'right' global setting.

Re: Make daylight saving a global option

Smartys wrote:

Adjust for DST: Daylight savings is in effect (advance times by 1 hour)
That is what it says

OK I see, I must have skimmed over that.

I still think it would be nice if setting this could be automated, then you could leave it out of the initial sign up page and it would just be another setting people can tinker with if needed.

Re: Make daylight saving a global option

That would be an extension, not part of the core. People disable Javascript, you can't rely on it 100%.

Re: Make daylight saving a global option

It would only be javascript if you were preseting the field. If you were leaving out the field alltogether it would just mean setting a default value based on a timezone/dst lookup to compare current date with dst dates. The problem with that is not only is it different from timezone to timezone but the dates aren't constant e.g. in UK its 2am on the last Sunday of October.

The only thing worse than finding a bug is knowing I created it in the first place.