Skip to content

Commit

Permalink
Regex to remove year from forecast date locale
Browse files Browse the repository at this point in the history
Creates a short date.

Updates #56
  • Loading branch information
poblabs committed Feb 5, 2019
1 parent a7dbe9d commit 9634f7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion skins/Belchertown/index.html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@
var weekday = "Today";
} else {
output_html += '<div class="col-sm-1-5 wuforecast border-left">';
var weekday = moment.unix( data["daily"]["data"][i]["time"] ).format( "ddd M/D" );
var weekday = moment.unix( data["daily"]["data"][i]["time"] ).format( "ddd l" ).replace(/([A-Z])|[\/\-\.]\b[0-9]{4}\b/g, ' $1'); // Removes "/Year", ".Year" and/or "-Year" - https://stackoverflow.com/a/12704805/1177153
}
output_html += '<span id="weekday">'+weekday+'</span>';
output_html += '<br>';
Expand Down

1 comment on commit 9634f7a

@poblabs
Copy link
Owner Author

@poblabs poblabs commented on 9634f7a Feb 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also updates #1

Please sign in to comment.