examples/phonegap1/platforms/ios/www/plugins/cordova-plugin-globalization/www/globalization.js
function (date, successCB, failureCB, options) {
        argscheck.checkArgs('dfFO', 'Globalization.dateToString', arguments);
        var dateValue = date.valueOf();
        exec(successCB, failureCB, 'Globalization', 'dateToString', [{'date': dateValue, 'options': options}]);
    }
function (date, successCB, failureCB, options) {
        argscheck.checkArgs('dfFO', 'Globalization.dateToString', arguments);
        var dateValue = date.valueOf();
        exec(successCB, failureCB, 'Globalization', 'dateToString', [{'date': dateValue, 'options': options}]);
    }
function ( date , successCB , failureCB , options ) { argscheck . checkArgs ( 'dfFO' , 'Globalization.dateToString' , arguments ) ; var dateValue = date . valueOf ( ) ; exec ( successCB , failureCB , 'Globalization' , 'dateToString' , [ { 'date' : dateValue , 'options' : options } ] ) ; }
Returns a date formatted as a string according to the client's user preferences and
calendar using the time zone of the client. It returns the formatted date string to the
successCB callback with a properties object as a parameter. If there is an error
formatting the date, then the errorCB callback is invoked.

The defaults are: formatLenght="short" and selector="date and time"

@param {Date} date
@param {Function} successCB
@param {Function} errorCB
@param {Object} options {optional}
formatLength {String}: 'short', 'medium', 'long', or 'full'
selector {String}: 'date', 'time', or 'date and time'

@return Object.value {String}: The localized date string

@error GlobalizationError.FORMATTING_ERROR

Example
globalization.dateToString(new Date(),
function (date) {alert('date:' + date.value + '\n');},
function (errorCode) {alert(errorCode);},
{formatLength:'short'});
Returns a date formatted as a string according to the client s user preferences and calendar using the time zone of the client . It returns the formatted date string to the successCB callback with a properties object as a parameter . If there is an error formatting the date then the errorCB callback is invoked .