SproutCMS

This is the code documentation for the SproutCMS project

function jsdate()

Returns the JS code needed to initialise a Date() object with the specified date.
This should only be used for dates. For times or date-times, use a different function.

From types:
  'mysql' - a mysql-formatted date in the form YYYY-MM-DD
  'array' - an array [ <day> , <month> , <year> ]

Usage

null|string Enc::jsdate ( string $value [, string $from ] );

Arguments

  1. string $value
    The value to convert.
  2. string $from = mysql
    What format the date was in origanally.

Return value

  • string
    JavaScript snippet for the given date or NULL if the input value is invalid
  • null
    JavaScript snippet for the given date or NULL if the input value is invalid