Skip to content

Commit da43920

Browse files
committed
Update forecast and earthquake time to use built in locale
Updates #56
1 parent ee38028 commit da43920

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Diff for: bin/user/belchertown.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def get_extension_list(self, timespan, db_lookup):
434434
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 )
435435

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

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

606606
try:
607-
eqtime = time.strftime( "%B %d, %Y, %-I:%M %p", time.localtime( eqdata["features"][0]["properties"]["time"] / 1000 ) )
607+
eqtime = time.strftime( "%c", time.localtime( eqdata["features"][0]["properties"]["time"] / 1000 ) )
608608
equrl = eqdata["features"][0]["properties"]["url"]
609609
eqplace = eqdata["features"][0]["properties"]["place"]
610610
eqmag = eqdata["features"][0]["properties"]["mag"]

Diff for: skins/Belchertown/index.html.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@
393393
output_html += '</div>';
394394
output_html += '</div>';
395395
}
396-
forecast_subtitle = moment.unix( data["currently"]["time"] ).format( 'MMMM D, YYYY, h:mm A' ); // August 14, 2018, 1:00 PM
396+
forecast_subtitle = moment.unix( data["currently"]["time"] ).format( 'LLL' );
397397
jQuery(".forecast-subtitle").text( "Last Updated on " + forecast_subtitle );
398398
jQuery(".forecasts").html( output_html );
399399
}

0 commit comments

Comments
 (0)