From da43920f68cbf7d61a8b042ffc80148d704c759b Mon Sep 17 00:00:00 2001 From: Pat Date: Mon, 4 Feb 2019 20:33:28 -0500 Subject: [PATCH] Update forecast and earthquake time to use built in locale Updates #56 --- bin/user/belchertown.py | 4 ++-- skins/Belchertown/index.html.tmpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/user/belchertown.py b/bin/user/belchertown.py index d2c1037f..7404707d 100644 --- a/bin/user/belchertown.py +++ b/bin/user/belchertown.py @@ -434,7 +434,7 @@ def get_extension_list(self, timespan, db_lookup): forecast_alert_text += " %s in effect until %s
" % ( 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"] @@ -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"] diff --git a/skins/Belchertown/index.html.tmpl b/skins/Belchertown/index.html.tmpl index 36be6956..c8a5a53b 100644 --- a/skins/Belchertown/index.html.tmpl +++ b/skins/Belchertown/index.html.tmpl @@ -393,7 +393,7 @@ output_html += ''; output_html += ''; } - 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 ); }