Description
Returns the JavaScript code to create the given date
Usage
$string = bw_jsdate( $date );Parameters
- $date
- ( string ) required – in format yyyy/mm/dd/hh/mm/ss, where the separators can be space, hyphen, period or slash
Returns
string JavaScript to create a new date enclosed in single quotes e.g. 'new Date( yyyy,mm,dd,hh,mm,ss )'Source
File name: oik/includes/bw_jquery.incLines:
1 to 9 of 9
function bw_jsdate( $date ) { $date = str_replace( array( " ", "-", ".", ":" ), "/", $date ); $dates = explode( "/", $date ); if ( isset( $dates[1] ) ) { $dates[1] -= 1; } $jsdate = implode( ",", $dates ); return( "'new Date( $jsdate )'" ); }View on GitHub View on Trac
Called by
1 to 1 of 1
