Skip to content

Commit

Permalink
Fix Clock Setting & Update Version Number + Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
consindo committed May 30, 2017
1 parent 63521a8 commit 61eba9b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
2 changes: 1 addition & 1 deletion js/stores/settingsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class settingsStore {
this.state[attrname] = preState[attrname]
}
}
localStorage.setItem('AppVersion', '1.1.0')
localStorage.setItem('AppVersion', '1.2.0')
}
getState() {
return this.state
Expand Down
20 changes: 16 additions & 4 deletions js/views/timetable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'

import { iOS } from '../models/ios.js'
import { StationStore } from '../stores/stationStore.js'
import { SettingsStore } from '../stores/settingsStore.js'
import { UiStore } from '../stores/uiStore.js'

export default class Timetable extends React.Component {
Expand Down Expand Up @@ -215,14 +216,25 @@ export default class Timetable extends React.Component {
<ul>
{this.state.trips.map(function(item, key) {
if ('seperator' in item) {
let timeString = (item.seperator % 12 === 0 ? 12 : item.seperator % 12) + ':00'
timeString += item.seperator >= 12 ? ' PM' : ' AM'
let timeString
if (SettingsStore.state.clock) {
timeString = item.seperator + ':00'
} else {
timeString = (item.seperator % 12 === 0 ? 12 : item.seperator % 12) + ':00'
timeString += item.seperator >= 12 ? ' PM' : ' AM'
}
return <li key={key} ref={'time'+item.seperator} className="seperator">{timeString}</li>
}
const absotime = parseInt(item.date.getUTCHours() + ('0' + item.date.getUTCMinutes()).slice(-2))
const name = item.route_long_name.split('Via')
let timestring = (item.date.getUTCHours() % 12 === 0 ? 12 : item.date.getUTCHours() % 12) + ':' + ('0' + item.date.getUTCMinutes()).slice(-2)
timestring += item.date.getUTCHours() >= 12 ? ' PM' : ' AM'

let timestring
if (SettingsStore.state.clock) {
timestring = item.date.getUTCHours() + ':' + ('0' + item.date.getUTCMinutes()).slice(-2)
} else {
timestring = (item.date.getUTCHours() % 12 === 0 ? 12 : item.date.getUTCHours() % 12) + ':' + ('0' + item.date.getUTCMinutes()).slice(-2)
timestring += item.date.getUTCHours() >= 12 ? ' PM' : ' AM'
}

let className = ''
if (absotime > currentTime && opacity === false) {
Expand Down
1 change: 0 additions & 1 deletion scss/_content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ $bgheight: 125px;
}
}
.error {
position: absolute;
z-index: 0;
line-height: 60px;
text-align: center;
Expand Down
14 changes: 11 additions & 3 deletions server/staticrender.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,17 @@ const staticrender = {
success()
}).catch(notFound)
} else if (path.length === 5) {
title = 'Realtime Trip Info' + defaultName
description = 'View live vehicle location in DYMAJO Transit.'
success()
if (path[3] === 'timetable') {
title = path[4].split('-')[0] + ' Timetable' + defaultName
description = 'View timetable in DYMAJO Transit.'
success()
} else if (path[3] === 'realtime') {
title = 'Realtime Trip Info' + defaultName
description = 'View live vehicle location in DYMAJO Transit.'
success()
} else {
return notFound()
}
} else {
return notFound()
}
Expand Down

0 comments on commit 61eba9b

Please sign in to comment.