Page 1 of 1

Addition to job schedule

Posted: Wed Oct 29, 2008 6:01 pm
by ijyoung

Posted: Wed Oct 29, 2008 6:47 pm
by davidgwalker

Posted: Wed Oct 29, 2008 6:50 pm
by davidgwalker

Posted: Wed Oct 29, 2008 7:32 pm
by ijyoung

Posted: Wed Oct 29, 2008 7:48 pm
by davidgwalker

Posted: Wed Oct 29, 2008 9:27 pm
by ijyoung

Posted: Thu Oct 30, 2008 8:04 am
by ijyoung

A solution

Posted: Thu Oct 30, 2008 11:10 am
by ijyoung
Following additions to the code allow the setting of the start date.

in add-modify.html
add extra input field <tr>
<td>Start Date</td><td><input class="box" name ="start" ></td>
</tr>
I have put this after the "name" input field.

In the add-modify.php we need the following:

$start=clean_input($_POST['start']);
$start = str_replace('/','-', $start);
$dat = date('Y-m-d', strtotime("$start"));
$startdate=strtotime("$dat");

This takes the date input, cleans it up replaces any slashes and converts to seconds.

The start date is then midnight of the day in question.
The time interval is set in usual manner.

So far it seems to work for both US and UK format of writing dates.

Hoep this is useful

Cheers

Ian