void smarty_function_bit_select_datetime(
$pParams, &$gBitSmarty)
|
|
smarty_function_bit_select_datetime
NOTE: This code looks good but needs intensive testing, especially with different date/time formats.
This function generates HTML code that adds a date picker to an HTML form. Depending on Bitweaver settings (Administration/Themes/Theme Settings) this can be the ordinary Smarty way of date/time picking (see html_select_date and html_select_time functions) or a nice javascript calendar.
Parameters: name The name of the inputfield. Use this to identify the date/datetime input from other inputs. (will be used for <input name="..., defaults to 'date'. showtime defines whether you need a date or datetime picking method. Set to 'true' or 'false', defaults to 'true'. format The datetime format used to display/return the timestamp. Defaults to the user's preference on this Bitweaver system. time The time value to be displayed, in the format given in the format parameter. Defaults to the current system time.
Usage sample: <form action="edit.php" method="POST"> {formlabel label="Test JSCalendar"} {forminput} {bit_select_datetime name="mydate2" time=$gContent->mInfo.start} {/forminput} </form>
Later, in edit.php, use this code to obtain the timestamp in UTC: $timestamp = $gBitSystem->mServerTimestamp->getUTCFromDisplayDate(_REQUEST['mydate2'])
Parameters