Page MenuHomePhabricator

Enable highlighting Saturdays in "Calendar-Wikivoyage" Extension
Open, Needs TriagePublic

Description

The "Calendar-Wikivoyage" Extension enables highlighting Sundays in red color, because in most of the world, Sunday is the day of rest.

However, according to the Jewish Calendar, the week starts in Sunday and ends in Saturday, which makes Saturday the weekly day of rest (instead of Sunday).

Currently, when we use this extension in hewikivoyage, Sundays are red-highlighted, although Saturdays have to be highlighted (for example: https://he.wikivoyage.org/wiki/דצמבר)..

Please add a class to the extension that enables highlighting Saturdays in the Jewish Calender, and make it default for the hewikivoyage.

If it's hard to do that, any other solution will be greatly appreciated and accepted as well :)

Thanks,

Event Timeline

DekelE created this task.Dec 17 2018, 10:08 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 17 2018, 10:08 PM

Hi @DekelE, thanks for taking the time to report this! Does code and a setting to set this already exist? Assuming there is not so I'm removing Wikimedia-Site-Requests (and the Core Platform Team as this is not maintained by them).

DekelE updated the task description. (Show Details)Dec 17 2018, 10:20 PM

Hi @DekelE, thanks for taking the time to report this! Does code and a setting to set this already exist? Assuming there is not so I'm removing Wikimedia-Site-Requests (and the Core Platform Team as this is not maintained by them).

I guess it doesn't exist. Sorry for all the mess I made with the tags... I tagged what I thought was related to this request.

No problem, happy to help :)

Aklapper raised the priority of this task from Normal to Needs Triage.Dec 17 2018, 11:39 PM
DekelE added a comment.Jan 2 2019, 4:36 PM

Is there any way to solve the problem or to highlight locally saturdays?

I fear that this request will be forgotten because nobody answered for more than two weeks....

It's not lost as this is a public issue tracking system, but it's up to anyone whether anyone decides to work on this or not. See https://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker if you (or anyone else) is interested in working on a software change.

@DekelE, if you would like to fix it yourself, I can mentor you how to get into mediawiki, and submit a patch

I propose the following solution: to add weekday classes like sundays to all table cells. Then css styles can be easily added to every day of the week not only for sundays.

I the file CalendarTable.php, in public function buildTable() two changes should be made:

  1. Adding an array at the beginning

old:

	public function buildTable() {

new

	public function buildTable() {
		$mDayStyles = array( 'mondays', 'tuesdays', 'wednesdays', 'thursdays',
			'fridays', 'saturdays', 'sundays' )
  1. Code replacement

old

				if ( $i == 0 && $this->weekStart == 0 ) {
					$styles[] = 'sundays';
				} elseif ( $i == 6 && $this->weekStart == 1 ) {
					$styles[] = 'sundays';
				}

new

				$styles[] = $mDayStyles[ ( $i+6+$this->weekStart ) % 7 ]

Unfortunately I do not know how to make this changes by myself.