/    Sign up×
Community /Pin to ProfileBookmark

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.

[code=php]
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
)

)
[/code]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@jazzmasterkcMay 06.2013 — 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?
×

Success!

Help @ncsflorida spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...