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

  • SEARCH
  • Home
  • 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 8970663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:45:48+00:00 2026-06-15T17:45:48+00:00

Is there an algorithm for weekly reminders ? For example, I set a reminder

  • 0

Is there an algorithm for weekly reminders ?

For example, I set a reminder for Thursday & I check the “weekly” option.
The Reminder is supposed to alert every Thursday then,but how is this done?

I thought about an idea, but I guess it’s very stupid:

  1. Get today’s “day”.
  2. Get today’s “date”.
  3. Get the wanted day number.
  4. Subtract both days from each other.
  5. using [4] get that day’s date.
  6. Increment the counter after every alert with 7.

I don’t even know whether this will work or not, I’m sure there is a better way to do it, so I need your opinions before starting implementation.

PS: I use JavaScript so the functions are very limited.

  • 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-06-15T17:45:49+00:00Added an answer on June 15, 2026 at 5:45 pm

    It’s not entirely clear what you’re trying to do.

    1. If your code needs to know whether it’s Thursday, that’s really easy using getDay, which gives you the day of the week:

      if (new Date().getDay() === 4) {
          // It's Thursday
      }
      

      The day numbers start with 0 = Sunday.

    2. If your code needs to find the next Thursday starting on a given date:

      var dt = /* ...the start date... */;
      while (dt.getDay() !== 4) {
          dt.setTime(dt.getTime() + 86400000)) // 86400000 = 1 day in milliseconds
      }
      

      or of course without the loop:

      var dt = /* ...the start date... */;
      var days = 4 - dt.getDay();
      if (days < 0) {
          days += 7;
      }
      dt.setTime(dt.getTime() + (days * 86400000));
      
    3. If you have a Thursday already and you need to know the date for the next Thursday:

      var nextThursday = new Date(thisThursday.getTime() + (86400000 * 7));
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an algorithm to estimate the median, mode, skewness, and/or kurtosis of set
Is there an algorithm like Aho-Corasick , which can match a set of patterns
Is there an algorithm or set of algorithms that would let you find the
As you know finding maximum independent set is NP. Is there an algorithm to
Is there an algorithm for figuring out the following things? If the result of
Is there an algorithm to securely split a message into x parts requiring at
Is there any algorithm in c# to singularize - pluralize a word (in english)
Is there any algorithm that gives the compass direction of a shadow given latitude,
Is there a preferred algorithm for converting a 2-digit year into a 4-digit year?
Is there an existing algorithm for converting a quaternion representation of a rotation to

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.