cmb69 / calendar_xh

Event calendars for CMSimple_XH
GNU General Public License v3.0
1 stars 1 forks source link

Make the beginning of the week language dependent #60

Open frase-git opened 3 years ago

frase-git commented 3 years ago

It would be desirable to be able to set the start of the week (Mon/Sun) depending on the language.

cmb69 commented 3 years ago

Right, makes sense. But what about week_end_day_1 and week_end_day_2? Does it even make sense to have separate settings for these three? In other words, isn't the weekend always the two days before the start of the week (that is for the Gregorian calendar; other calendars are not supported anyway).

frase-git commented 3 years ago

I think that the weekends always result from the beginning of the week. So _week_end_day1 and _week_end_day2 could be omitted as configuration option - I guess.
Sure: This can only apply to the Gregorian calendar. We don't have anything else ;-)

cmb69 commented 3 years ago

Well, it might not be that simple: https://en.wikipedia.org/wiki/Workweek_and_weekend. Sigh. For BC reasons, I won't touch the weekend day settings for 2.x (it should currently be possible to set both to the same day).

Still, I think it makes sense to move the start of the week setting to the language, but for BC reasons only make that effective, if the respective configuration setting is not available (i.e. users must remove it from config.php and defaultconfig.php after update).

However, I'm not sure how the language setting actually should work. Since there is no type info for language texts, we cannot have a nice checkbox. And actually, this should probaly don't be a boolean setting at all. Should we allow to enter the name of the day to start the week (Sunday, Monday, …, or maybe an abbreviation, perhaps even the abbreviation in the daynames_array)? What would be the default in case of an empty or invalid value?

cmb69 commented 3 years ago

Tentatively setting the 2.1 Milestone. @frase-git, do you need this, or would it just be a nice-have?

frase-git commented 3 years ago

You're right, it's all not so simple.

In the language settings I would enter the beginning of the week as text. So: Mo, Tu, We ... etc. according to daynames_array (and not allow anything else). As default value in case of wrong input: Mo, because it is like this in most countries.

And by the way: I don't need it urgently at the moment ;-) I only noticed this question while dealing with the calendar.

cmb69 commented 3 years ago

In the language settings I would enter the beginning of the week as text. So: Mo, Tu, We ... etc. according to daynames_array (and not allow anything else). As default value in case of wrong input: Mo, because it is like this in most countries.

That makes perfect sense. Thanks!

And by the way: I don't need it urgently at the moment ;-)

Fine. I'll postpone that then to get out Calendar_XH 2.1 sooner.