Skip to content

Commit

Permalink
make bulletin date readable
Browse files Browse the repository at this point in the history
  • Loading branch information
brightrain committed Sep 30, 2021
1 parent cbf5c06 commit 6046240
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h5>
<li v-for="bulletin in selectedTerminal.bulletins" :key="bulletin.BulletinTitle">
<b>{{ bulletin.BulletinTitle }}</b>
<div v-html="bulletin.BulletinText"></div>
<i>{{ bulletin.BulletinLastUpdatedSortable }}</i>
<i>{{ bulletin.BulletinLastUpdatedReadable }}</i>
<br>
</li>
</ul>
Expand Down
14 changes: 10 additions & 4 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ require([
bulletinTerminalMarker: {
type: "picture-marker",
url: "assets/terminal-with-bulletin.svg",
width: "40px",
height: "32px",
width: "55px",
height: "43px",
angle: 0
},
config: {
Expand Down Expand Up @@ -195,7 +195,8 @@ require([
"BulletinText":"String content",
"BulletinSortSeq":2147483647,
"BulletinLastUpdated":"\/Date(928174800000-0700)\/",
"BulletinLastUpdatedSortable":"String content"
"BulletinLastUpdatedSortable":"String content",
"BulletinLastUpdatedReadable":"String content"
}],
waitTimes: [{
"RouteID": 0,
Expand Down Expand Up @@ -235,7 +236,8 @@ require([
"BulletinText":"String content",
"BulletinSortSeq":2147483647,
"BulletinLastUpdated":"\/Date(928174800000-0700)\/",
"BulletinLastUpdatedSortable":"String content"
"BulletinLastUpdatedSortable":"String content",
"BulletinLastUpdatedReadable":"String content"
}],
waitTimes: [{
"RouteID": 0,
Expand Down Expand Up @@ -471,6 +473,8 @@ require([
this.config.ferryFeedParams, terminalBulletin => {
terminalBulletin.Bulletins.forEach(b => {
if(this.isToday(b.BulletinLastUpdated)) {
// set the bulletin time to human readable
b.BulletinLastUpdatedReadable = this.convertToHumanDate(b.BulletinLastUpdated);
this.selectedTerminal.bulletins.push(b);
}
});
Expand Down Expand Up @@ -589,6 +593,8 @@ require([
// if this bulletin was issues today add it to this terminals Today's Bulletins
terminalBulletin.Bulletins.forEach(b => {
if(this.isToday(b.BulletinLastUpdated)) {
// set the bulletin time to human readable
b.BulletinLastUpdatedReadable = this.convertToHumanDate(b.BulletinLastUpdated);
terminalForBulletin.bulletins.push(b);
// get the graphic related to this terminal
let existingTerminalGraphic = this.terminalsGraphicsLayer.graphics.items.find(t => {
Expand Down

0 comments on commit 6046240

Please sign in to comment.