protected function newClientDate($value, $meta)
    {
        $format = Utility::get($meta, "format");
        $type = Utility::get($meta, "type");
        if ($format == null) {
            switch ($type) {
            case "date":
                $format = "Y-m-d";
                $toFormat = "Y,(n-1),d";
                break;
            case "time":
                $format = "H:i:s";
                $toFormat = "0,0,0,H,i,s";
                break;
            case "datetime":
            default:
                $format = "Y-m-d H:i:s";
                $toFormat = "Y,(n-1),d,H,i,s";
                break;
            }
        }
        //The (n-1) above is because in Javascript, month start from 0 to 11
        $date = \DateTime::createFromFormat($format, $value);

        if ($date) {
            return "new Date(" . \DateTime::createFromFormat($format, $value)->format($toFormat) . ")";
        }
        return "null";
    }
protected function newClientDate($value, $meta)
    {
        $format = Utility::get($meta, "format");
        $type = Utility::get($meta, "type");
        if ($format == null) {
            switch ($type) {
            case "date":
                $format = "Y-m-d";
                $toFormat = "Y,(n-1),d";
                break;
            case "time":
                $format = "H:i:s";
                $toFormat = "0,0,0,H,i,s";
                break;
            case "datetime":
            default:
                $format = "Y-m-d H:i:s";
                $toFormat = "Y,(n-1),d,H,i,s";
                break;
            }
        }
        //The (n-1) above is because in Javascript, month start from 0 to 11
        $date = \DateTime::createFromFormat($format, $value);

        if ($date) {
            return "new Date(" . \DateTime::createFromFormat($format, $value)->format($toFormat) . ")";
        }
        return "null";
    }
protected function newClientDate ( $ value , $ meta ) { $ format = Utility :: get ( $ meta , "format" ) ; $ type = Utility :: get ( $ meta , "type" ) ; if ( $ format == null ) { switch ( $ type ) { case "date" : $ format = "Y-m-d" ; $ toFormat = "Y,(n-1),d" ; break ; case "time" : $ format = "H:i:s" ; $ toFormat = "0,0,0,H,i,s" ; break ; case "datetime" : default : $ format = "Y-m-d H:i:s" ; $ toFormat = "Y,(n-1),d,H,i,s" ; break ; } } //The (n-1) above is because in Javascript, month start from 0 to 11 $ date = \ DateTime :: createFromFormat ( $ format , $ value ) ; if ( $ date ) { return "new Date(" . \ DateTime :: createFromFormat ( $ format , $ value ) -> format ( $ toFormat ) . ")" ; } return "null" ; }
Convert server-side date to client-side format

@param string $value The datetime
@param array  $meta  The meta data

@return string The client-side date format
Convert server - side date to client - side format