Skip to content

Commit

Permalink
Merge pull request #8 from DilwoarH/jummah-blackout-periods
Browse files Browse the repository at this point in the history
Jummah blackout periods
  • Loading branch information
DilwoarH authored Feb 12, 2019
2 parents 8869c50 + 8b09f64 commit c1cd0c8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Changelog

- Mark breaking changes with `BREAKING:`. Be sure to include instructions on how applications should be upgraded.
- Include a link to your pull request.
- Don't include changes that are purely internal. The CHANGELOG should be a
useful summary for people upgrading their application, not a replication
of the commit log.

## 3.0.0
- BREAKING: Adds blackout periods for jummah - need to add in `blackOutPeriod_jummah` into Google Sheets App config.
- Google Sheets Template updated - https://docs.google.com/spreadsheets/d/1yVlGjnEhKLi5DSOuJMm7-ec5-iFvuiR7WkbzMdbFP9s/edit?usp=sharing
- Adds in CHANGELOG.md

## 2.0.0
- iPad and iPhone responsive

## 1.0.0
- Initial App release
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mosque-screen",
"version": "2.0.0",
"version": "3.0.0",
"private": true,
"main": "public/electron.js",
"homepage": "https://mosque-screen.netlify.com",
Expand Down
10 changes: 8 additions & 2 deletions src/_components/blackout-periods/blackout-periods.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class BlackoutPeriods extends Component {
zuhr: _appConfig.get('blackOutPeriod_zuhr'),
asr: _appConfig.get('blackOutPeriod_asr'),
maghrib: _appConfig.get('blackOutPeriod_maghrib'),
isha: _appConfig.get('blackOutPeriod_isha')
isha: _appConfig.get('blackOutPeriod_isha'),
jummah: _appConfig.get('blackOutPeriod_jummah')
}
};
}
Expand Down Expand Up @@ -48,18 +49,23 @@ class BlackoutPeriods extends Component {
.format('HH:mm');
}

isJummahPeriod(prayerName) {
return moment().day() === 5 && prayerName === 'zuhr';
}

isBlackout(prayerName) {
// return true; // for testing
var todaysPrayerTime = this.getPrayerTimes();
var durations = this.state.blackOutPeriods;
var currentTime = this.getCurrentTime();
var isJummahPeriod = this.isJummahPeriod(prayerName);

if (
currentTime >= this.stringToTime(todaysPrayerTime[prayerName]) &&
currentTime <=
this.getBlackoutEndTime(
this.stringToTime(todaysPrayerTime[prayerName]),
durations[prayerName]
isJummahPeriod ? durations['jummah'] : durations[prayerName]
)
) {
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"buildNumber": "v2.0.0",
"buildNumber": "v3.0.0",
"sliderMode": "slider",
"slideTimeout": 8000,
"googleSlides": {
Expand Down

0 comments on commit c1cd0c8

Please sign in to comment.