close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Add 3 months to a posted date in Insert behavior

Thread began 11/19/2021 9:49 am by MagsW | Last modified 11/19/2021 5:06 pm by MagsW | 8 views | 3 replies


Add 3 months to a posted date in Insert behavior

Hi Ray, I've buit an online calendar reminder system which allows users to log specific events. There is one event that occurs quarterly, so rather than asking users to insert the event 4 times I've added a second insert behavior on the page that triggers if the user selects that particular event, and it should automatically add duplicate entries with dates of 3, 6 & 9 months after the entered date - so for example if the user adds the event dated 30 November 2021, I want it to also add entries for 28 February, 30 May and 30 August 2022. I've only added a 3 month increment so far for testing - the insert behavior works but the date doesn't, it's defaulting to a 1970 date. This is my current line from the Insert behavior:

$InsertQuery->bindColumn("EventDate", "t", "".((isset($_POST["datepickerDefault"]) && $_POST["datepickerDefault"]!="" )?date("Y-m-d", strtotime("+3 month", $_POST["datepickerDefault"])):"") ."", "WA_DEFAULT");

I'm assuming I've put the + 3 month in the wrong place - can you advise? Also, I believe there are issues with adding date increments if the date falls on the last day of the month and so will cause problems for dates of 31st (and 29th/30th in the case of February). Do you know how I can get around this?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...