www.webdeveloper.com
Results 1 to 2 of 2

Thread: Getting All Dates for next 2 months by numeric day representation

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Posts
    15

    Getting All Dates for next 2 months by numeric day representation

    I need help solving a problem and I can't think up a solution for...I've trying to get this array onto a calendar but I need to get the full date and time for all days in the next say 2 months with the respective day number (same as PHP's date day number "w"). Any help would be greatly appreciated. Hopefully I've made sense.

    PHP Code:
    Array
    (
        [
    1] => Array
            (
                [
    id] => 1
                
    [title] => Event #1
                
    [day] => 1
                
    [start] => 12:30
                
    [finish] => 13:00
            
    )

        [
    2] => Array
            (
                [
    id] => 2
                
    [title] => Event #2
                
    [day] => 6
                
    [start] => 14:00
                
    [finish] => 14:30
            
    )

        [
    3] => Array
            (
                [
    id] => 3
                
    [title] => Event #3
                
    [day] => 3
                
    [start] => 12:30
                
    [finish] => 13:00
            
    )



  2. #2
    Join Date
    Jul 2012
    Posts
    57
    When you fetch the date it returns between 01-12 for the month. When I made a calendar a while back I had each returned value by a key in the array for a month name.. IE:
    array("January"=>01 ..and so forth)
    Make an enumeration for the months, so it would be easier to add instead of trying to add 01+01 since that's not really going to work.

    Are your events stored in a database or hardcoded into the php?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles