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 8869611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:31:10+00:00 2026-06-14T17:31:10+00:00

I am trying to work on something very simple in Javascript. I need the

  • 0

I am trying to work on something very simple in Javascript. I need the script to print out the date in the following format: yyyymmdd/yyyymmdd.

I just cant get the following script to work. It feeds a google calendar to output current Day view.

  var today = new Date();
    var dd = today.getDate();
    var mm = today.getMonth()+1; //January is 0!
    var yyyy = today.getFullYear();

    if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} today = yyyy+''+mm+''+dd;



    document.write ('<iframe src="https://www.google.com/calendar/embed?

        showTitle=0&amp;dates=today"/"today&amp;mode=DAY&amp;height=1200&amp;wkst=1&amp;hl=en_GB&amp;bgcolor

=%23FFFFFF&amp;src=my cal source&amp;color=%23711616&amp;ctz=Etc%2FGMT" style=" border:solid 

1px #777 " width="950" height="715"frameborder="0" scrolling="no"></iframe>');
  • 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-14T17:31:11+00:00Added an answer on June 14, 2026 at 5:31 pm

    The problem is string concatenation. You have to tell to JS what is a string and what is variable to add. Update your code as below:

    document.write( '<iframe src="https://www.google.com/calendar/embed?showTitle=0&amp;dates='
        + today + '/' + today +
        '&amp;mode=DAY&amp;height=1200&amp;wkst=1&amp;hl=en_GB&amp;bgcolor=%23FFFFFF&src=my cal source&color=%23711616&ctz=Etc%2FGMT" style=" border:solid 1px #777 " width="950" height="715"frameborder="0" scrolling="no">' )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This must be something very simple for the JavaScript experts out there. In the
I am trying something very simple, but for some reason it does not work.
I am trying something very simple but somehow I can't get it to work.
i am trying to work out the following problem in Java (although it could
Currently I am trying something very simple. I am looking through an XML document
I am trying to do something very simple. I want to display an image
SOLVED, ERROR IN THE JAVASCRIPT-FILE I'm trying to get a very simple autocomplete test
I am new to ASP.NET MVC3 and trying desperately to just get something simple
I'm trying to find a very simple and smooth, lightweight javascript or jquery marquee.
It's a very simple question but I couldn't figure it out. I'm trying 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.