Skip to content

Commit

Permalink
Update forecast and earthquake time to use built in locale
Browse files Browse the repository at this point in the history
Updates #56
  • Loading branch information
poblabs committed Feb 5, 2019
1 parent ee38028 commit da43920
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/user/belchertown.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def get_extension_list(self, timespan, db_lookup):
forecast_alert_text += "<i class='fa fa-exclamation-triangle'></i> <a href='%s' target='_blank'>%s in effect until %s</a><br>" % ( alert['uri'], alert['title'], alert_expires )

forecast_html_output = ""
forecast_updated = time.strftime( "%B %d, %Y, %-I:%M %p %Z", time.localtime( data["currently"]["time"] ) )
forecast_updated = time.strftime( "%c", time.localtime( data["currently"]["time"] ) )
current_obs_summary = data["currently"]["summary"]
visibility = data["currently"]["visibility"]

Expand Down Expand Up @@ -604,7 +604,7 @@ def get_extension_list(self, timespan, db_lookup):
eqdata = json.load( read_file )

try:
eqtime = time.strftime( "%B %d, %Y, %-I:%M %p", time.localtime( eqdata["features"][0]["properties"]["time"] / 1000 ) )
eqtime = time.strftime( "%c", time.localtime( eqdata["features"][0]["properties"]["time"] / 1000 ) )
equrl = eqdata["features"][0]["properties"]["url"]
eqplace = eqdata["features"][0]["properties"]["place"]
eqmag = eqdata["features"][0]["properties"]["mag"]
Expand Down
2 changes: 1 addition & 1 deletion skins/Belchertown/index.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@
output_html += '</div>';
output_html += '</div>';
}
forecast_subtitle = moment.unix( data["currently"]["time"] ).format( 'MMMM D, YYYY, h:mm A' ); // August 14, 2018, 1:00 PM
forecast_subtitle = moment.unix( data["currently"]["time"] ).format( 'LLL' );
jQuery(".forecast-subtitle").text( "Last Updated on " + forecast_subtitle );
jQuery(".forecasts").html( output_html );
}
Expand Down

0 comments on commit da43920

Please sign in to comment.