I just need some general ideas on how I could do this.
I am working on a community events script. The way the boss wants it organized is with the twelve months on the side, the user clicks on the month, and it displays the closest events first, and any past events are deleted.
I think the easy way to do this would be to have various pull down menus when the user submits an event. Remember, that users can only post events for future dates only. I want a pull down menu for the 12 months, one for the days of the month, and one for years. I'm not sure how I should restrict the user from submitting past events.. just not let them show up in the pulldown menu, or have an error page saying "you choose a past date" or something like that.
But really, the thing I don't understand how to do, would be how to relate to the date selected by the user and to the date on the server. Because, i want to make sure that whenever someone runs the script at a later date, if any postings are older than the current date, i want to delete them. I don't know how I could go about doing this, and how I could compensate for leep years and all of that fun stuff.
Could someone point me in the direction of some helpfull functions, or tutorials, or something that might be of use to me. Because I've never worked this much with dates, and I'm a little scared. Heh.
Thanks monks.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.