"Invalid date" within weather forecast

See original GitHub issue

This seemed to start after performing latest update. Weather forecast had been working for me for a long time (I built the mirror at least two or three years ago).

Logs don’t seem to reveal much:

mm-0 Starting MagicMirror: v2.4.0-dev mm-0 Loading config … mm-0 Loading module helpers … mm-0 No helper found for module: alert. mm-0 Initializing new module helper … mm-0 Module helper loaded: MMM-Motion-Detection mm-0 No helper found for module: clock. mm-0 No helper found for module: MMM-Nest. mm-0 Initializing new module helper … mm-0 Module helper loaded: calendar mm-0 No helper found for module: currentweather. mm-0 No helper found for module: weatherforecast. mm-0 Initializing new module helper … mm-0 Module helper loaded: newsfeed mm-0 All module helpers loaded. mm-0 Starting server on port 8080 … mm-0 Server started … mm-0 Connecting socket for: MMM-Motion-Detection mm-0 Starting module helper: MMM-Motion-Detection mm-0 Connecting socket for: calendar mm-0 Starting node helper for: calendar mm-0 Connecting socket for: newsfeed mm-0 Starting module: newsfeed mm-0 Sockets connected & modules started … mm-0 Launching application. mm-0 Create new calendar fetcher for url: h mm-0 Create new news fetcher for url: http://feeds.arstechnica.com/arstechnica/index/ - Interval: 300000 mm-0 Create new news fetcher for url: http://www.npr.org/rss/rss.php?id=1001 - Interval: 300000 mm-0 [MMM-Motion-Detection] Motion Detection started… mm-0 [MMM-Motion-Detection] -------------------- mm-0 [MMM-Motion-Detection] Webcam starting… mm-0 [MMM-Motion-Detection] motion detected mm-0 Starting MagicMirror: v2.4.0-dev mm-0 Loading config … mm-0 Loading module helpers … mm-0 No helper found for module: alert. mm-0 Initializing new module helper … mm-0 Module helper loaded: MMM-Motion-Detection mm-0 No helper found for module: clock. mm-0 No helper found for module: MMM-Nest. mm-0 Initializing new module helper … mm-0 Module helper loaded: calendar mm-0 No helper found for module: currentweather. mm-0 No helper found for module: weatherforecast. mm-0 Initializing new module helper … mm-0 Module helper loaded: newsfeed mm-0 All module helpers loaded. mm-0 Starting server on port 8080 … mm-0 Server started … mm-0 Connecting socket for: MMM-Motion-Detection mm-0 Starting module helper: MMM-Motion-Detection mm-0 Connecting socket for: calendar mm-0 Starting node helper for: calendar mm-0 Connecting socket for: newsfeed mm-0 Starting module: newsfeed mm-0 Sockets connected & modules started … mm-0 Launching application. mm-0 Create new news fetcher for url: http://feeds.arstechnica.com/arstechnica/index/ - Interval: 300000 mm-0 Create new news fetcher for url: http://www.npr.org/rss/rss.php?id=1001 - Interval: 300000 mm-0 [MMM-Motion-Detection] Motion Detection started… mm-0 [MMM-Motion-Detection] -------------------- mm-0 [MMM-Motion-Detection] Webcam starting… mm-0 [MMM-Motion-Detection] motion detected

and config doesn’t show any problems with the config checker:

/* Magic Mirror Config Sample
 *
 * By Michael Teeuw http://michaelteeuw.nl
 * MIT Licensed.
 */

var config = {
	port: 8080,

	language: 'en',
	timeFormat: 12,
	units: 'imperial',

	modules: [
		{
			module: 'alert',
		},
		{
			module: 'MMM-Motion-Detection',
		},
		{
			module: 'clock',
			position: 'top_left'
		},
		{
			module: 'MMM-Nest',
			position: 'bottom_right',
			config: {
				token:"xxx"
			}
		},
		{
			module: 'calendar',
			header: 'Calendar',
			position: 'top_left',
			config: {
				calendars: [
					{
						symbol: 'calendar-check-o ',
						url: 'xxx'
					}


				]
			}
		},
		
		{
			module: 'currentweather',
			position: 'top_right',
			config: {
				location: 'xxx',
				locationID: 'xxx',  //ID from http://www.openweathermap.org
				appid: 'xxx'
			}
		},
		{
			module: 'weatherforecast',
			position: 'top_right',
			header: 'Weather Forecast',
			config: {
	            location: 'xxx',
				locationID: 'xxx',  //ID from http://www.openweathermap.org
	            appid: 'xxx'
			}
		},
		{
			module: 'newsfeed',
			position: 'bottom_bar',
			config: {
				feeds: [
					{
						title: "ArsTechnica",
						url: "http://feeds.arstechnica.com/arstechnica/index/",
					},
					{
						title: "NPR",
						url: "http://www.npr.org/rss/rss.php?id=1001"
					}
				],
				showSourceTitle: true,
				showPublishDate: true
			}
		},
	]

};

/*************** DO NOT EDIT THE LINE BELOW ***************/
if (typeof module !== 'undefined') {module.exports = config;}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
GregoryOrciuchcommented, Jul 3, 2018

@Hilzerak solution is pretty manual for now: you edit this file: modules/default/weatherforecast/weatherforecast.js and change around lines 336-337 back to:

var day = moment(forecast.dt, "X").format("ddd");
var hour = moment(forecast.dt, "X").format("H");

then restart MM.

or this is exact upcoming change from pull request, you can apply it manualy: https://github.com/MichMich/MagicMirror/pull/1341/commits/dc3e960e792cfba3950c788f31618f1312bad0e3

0reactions
Canterraincommented, Jul 3, 2018

I can confirm that this update fixed this issue!

Thank you everybody!

Read more comments on GitHub >

github_iconTop Results From Across the Web

simpleWeather and moment.js - invalid date with js ...
I wanted to create a Weather Plugin for my Website. So i choose the simpleWeather Plugin. The simpleWeather Plugin used the moment.js lib...
Read more >
Weather app says wrong day - Apple Community
Seems to be a common issue based on reports. It's about 1am Wednesday in Manhattan but Weather app says it's Tuesday here.
Read more >
Error handling for invalid date (and potentially other errors) #16
It appears if you reach the historical limit for weather data (e.g. I was trying to scrape for a date in 2008), the...
Read more >
Future weather file error - Unmet Hours
I made a future weather file for 2080. When I launched the jeplus project using this weather file I got an " Reading...
Read more >
Disclaimer - National Weather Service
The information on National Weather Service (NWS) Web pages are in the public ... be given to the date and time of the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found