Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:12:46+00:00 2026-05-30T01:12:46+00:00

What I am making is a weather forecast website, and what I need is

  • 0

What I am making is a weather forecast website, and what I need is the days of the week (ie. “Sunday”, “Monday”, etc.). To get tomorrow’s date I am just putting “+ 1” like someone suggested in another question, but when it get’s to Saturday, it says “undefined”. How do I make it so when it gets to Saturday, + 1 will loop over to Sunday? Thanks in advance!

var day=new Date();
var weekday=new Array(7);
weekday[0]="Sunday";
weekday[1]="Monday";
weekday[2]="Tuesday";
weekday[3]="Wednesday";
weekday[4]="Thursday";
weekday[5]="Friday";
weekday[6]="Saturday";

document.getElementById('tomorrow').innerHTML = weekday[day.getDay() + 1];
document.getElementById('twodays').innerHTML = weekday[day.getDay() + 2];
document.getElementById('threedays').innerHTML = weekday[day.getDay() + 3];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:12:49+00:00Added an answer on May 30, 2026 at 1:12 am

    Use (day.getDay() + i) % 7. That will only return results between 0-6.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been strugling a couple of days. I'm making a local weather app and
I am making a SQL query towards a weather database, i need the wind_direction
I'm making an android app - where I need to have weather-information. I've found
I am making a JavaScript app which shows the weather of several places. Using
In a ASP.MVC (1.0) project i managed to get weather info from a RSS
In my web app I'm making a CURL call to Google's (unofficial) weather API
I am about to build an SQL database and I need to get it
Hi I am doing a screen scrape on a weather website that has inline
Making game of life I need to a have a grid that is 30x20
I am making a weather app with left, right gesture controls. Meaning a user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.