Skip to content

Commit

Permalink
Add Calendar Exceptions to new Query
Browse files Browse the repository at this point in the history
  • Loading branch information
consindo committed Oct 30, 2016
1 parent be4bdd1 commit 2291c38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/views/tripitem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ class TripItem extends React.Component<ITripItemProps, {}> {
}

// remove train station because it's unecessary
var name = this.props.name.replace(' Train Station', '')
var name = this.props.name.replace('/N', '')
name = name.replace('/PAN', '')
name = name.replace(' Ferry Terminal', '')

// removed <li>›</li> for now
Expand Down
8 changes: 8 additions & 0 deletions server/station.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,14 @@ var station = {
} else {
var data = []
result.entries.forEach(function(trip) {
// checks the exception to check if the frequency was added.
// only continue if it's supposed to be there
var exceptions = JSON.parse(trip.exceptions._)[currentDate.isoWeekday() - 1]
if (exceptions.length > 0) {
if (exceptions.indexOf(currentDate.toISOString()) === -1) {
return
}
}
data.push({
trip_id: trip.RowKey._,
arrival_time_seconds: trip.arrival_time_seconds._,
Expand Down

0 comments on commit 2291c38

Please sign in to comment.