SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: calendar

  1. #1
    SitePoint Zealot maileen's Avatar
    Join Date
    Apr 2006
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question calendar

    Hi,

    I'm writing a calendar in JS and i would like to know how :
    - can i know the date of today (e.g : Monday, March 26th 2007)
    - can i know which day (Monday, tuesday,..) was the 1st day of the current month ?

    thanks a lot,

    M.

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by maileen View Post
    Hi,

    I'm writing a calendar in JS and i would like to know how :
    - can i know the date of today (e.g : Monday, March 26th 2007)
    Code:
    var today = new Date();
    alert("Today is " + today);
    Quote Originally Posted by maileen View Post
    - can i know which day (Monday, tuesday,..) was the 1st day of the current month ?
    Use the getDay method. It will return you a number between 0-6. Use an Array with the days to get the names of the day.
    Quote Originally Posted by maileen View Post

    thanks a lot,

    M.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •