partial.js logo
Latest version
v1.3.1 (RC2)

Date.prototype


Date prototype is available in each node.js / partial.js script. Prototypes are defined in FrameworkUtils (utils.js). FrameworkUtils is a global variable.

Methods


Date.prototype.add(type, count)Date.prototype.format(format)
Date.prototype.add(type, count);
return Date;

Add years / months / days / hours / minutes / seconds to Date object.
Example: new Date().add('day', 1) or new Date().add('month', -1)

Date.prototype.format(format);
return String;

Formatting date. Example: new Date().format('dd.MM.yyyy HH:mm:ss')