Skip to content

Commit

Permalink
add new option showTomorrow
Browse files Browse the repository at this point in the history
add new option showTomorrow (display tomorrow praying time or not)
  • Loading branch information
slametps committed Apr 16, 2019
1 parent c26483d commit a93b895
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# MMM-PrayerTime Change Log
All notable changes to this project will be documented in this file.

## [1.0.2] - 2019-04-16

### Added
- option to display tomorrow praying time or not (default = true)

## [1.0.1] - 2018-05-17

### Changed
Expand Down
29 changes: 17 additions & 12 deletions MMM-PrayerTime.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Module.register("MMM-PrayerTime",{
language: config.language || "en",
colored: false,
showAdzanAlert: true,
showTomorrow: true,
alertTimer: 15000
},

Expand Down Expand Up @@ -271,12 +272,14 @@ Module.register("MMM-PrayerTime",{
occasionTime.innerHTML = this.translate('TODAY');
row.appendChild(occasionTime);

// nextday
var occasionTimeNext = document.createElement("td");
occasionTimeNext.className = "occasion-time bright light";
//occasionTimeNext.innerHTML = this.todaySchedule[t];
occasionTimeNext.innerHTML = this.translate('TOMORROW');
row.appendChild(occasionTimeNext);
if (this.config.showTomorrow) {
// nextday
var occasionTimeNext = document.createElement("td");
occasionTimeNext.className = "occasion-time bright light";
//occasionTimeNext.innerHTML = this.todaySchedule[t];
occasionTimeNext.innerHTML = this.translate('TOMORROW');
row.appendChild(occasionTimeNext);
}

//for (var i = 0, count = this.todaySchedule.length; i < count; i++) {
//for (t in this.todaySchedule)
Expand All @@ -301,12 +304,14 @@ Module.register("MMM-PrayerTime",{
occasionTime.innerHTML = (this.config.timeFormat == 12 ? moment(this.arrTodaySchedule[t][1], ["HH:mm"]).format("h:mm A") : this.arrTodaySchedule[t][1]);
row.appendChild(occasionTime);

// nextday
var occasionTimeNext = document.createElement("td");
occasionTimeNext.className = "occasion-time bright light";
//occasionTimeNext.innerHTML = this.todaySchedule[t];
occasionTimeNext.innerHTML = (this.config.timeFormat == 12 ? moment(this.arrNextdaySchedule[t][1], ["HH:mm"]).format("h:mm A") : this.arrNextdaySchedule[t][1]);
row.appendChild(occasionTimeNext);
if (this.config.showTomorrow) {
// nextday
var occasionTimeNext = document.createElement("td");
occasionTimeNext.className = "occasion-time bright light";
//occasionTimeNext.innerHTML = this.todaySchedule[t];
occasionTimeNext.innerHTML = (this.config.timeFormat == 12 ? moment(this.arrNextdaySchedule[t][1], ["HH:mm"]).format("h:mm A") : this.arrNextdaySchedule[t][1]);
row.appendChild(occasionTimeNext);
}
}

wrapper.appendChild(table);
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ modules: [
animationSpeed: 2.5 * 1000, // Speed of the update animation. (milliseconds)
language: config.language,
showAdzanAlert: true,
showTomorrow: true,
alertTimer: 15000
}
}
Expand Down Expand Up @@ -141,6 +142,13 @@ The following properties can be configured:
<br><b>Default value:</b> <code>true</code>
</td>
</tr>
<tr>
<td><code>showTomorrow</code></td>
<td>Display tomorrow praying time?
<br><b>Possible values:</b> <code>true, false</code>
<br><b>Default value:</b> <code>true</code>
</td>
</tr>
<tr>
<td><code>alertTimer</code></td>
<td>How long alert will be displayed? (milliseconds)<br>
Expand Down

0 comments on commit a93b895

Please sign in to comment.