Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h6 class="card-subtitle mb-2 text-muted"><address>{{ event.address }}</address>
</table>
<p v-if="!(event.fajrIqama || event.juma1)">Check website for prayer times.</p>
<p v-if="event.diffTz" class="text-warning">Note: This masjid may be in a a different time zone</p>
<small v-bind:class="{ 'text-danger': event.stale }">
<small v-if="event.showUpdatedLabel" v-bind:class="{ 'text-danger': event.stale }">
last updated {{ event.updatedLabel }} ago<br>
</small>
</div>
Expand Down Expand Up @@ -170,4 +170,3 @@ <h6 class="card-subtitle mb-2 text-muted"><address>{{ event.address }}</address>
</body>

</html>

10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,11 @@ window.getCurrentPosition = getCurrentPosition

function docToEvent (doc) {
const evt = doc.data()
const crawlTime = (
evt.crawlTime && typeof evt.crawlTime.toDate === 'function'
? evt.crawlTime.toDate()
: (evt.crawlTime instanceof Date ? evt.crawlTime : null)
)

const times = SunCalc.getTimes(now, evt.geo.latitude, evt.geo.longitude)
const fcmTopic = '/topics/' + doc.id
Expand All @@ -441,8 +446,9 @@ function docToEvent (doc) {
juma1IsModified: (evt.juma1Modified && hoursSince(evt.juma1Modified.toDate()) < 24),
juma2IsModified: (evt.juma2Modified && hoursSince(evt.juma2Modified.toDate()) < 24),
juma3IsModified: (evt.juma3Modified && hoursSince(evt.juma3Modified.toDate()) < 24),
updatedLabel: timeSince(evt.crawlTime.toDate()),
stale: (hoursSince(evt.crawlTime.toDate()) > 12)
showUpdatedLabel: (!evt.isStatic && Boolean(crawlTime)),
updatedLabel: crawlTime ? timeSince(crawlTime) : '',
stale: (crawlTime ? (hoursSince(crawlTime) > 12) : false)
}, evt)
return merged
}
Expand Down
Loading