datePart

gets the date part of a date object

object datePart(object date,boolean copy);

Parameters

dateobjecta date object
copybooleandefines whether a copy of the date will be created

Returns

objectthe date part of the date object

Example

var date1 = new Date(2012,11,12,8,35);
// the copy parameter is set to false, the date won't be copied
// so the date passed as a 1st parameter will be modified
var date2 = webix.Date.datePart(date1);
 
console.log(date1); // -> Wed Dec 12 2012 00:00:00 GMT+0300 
console.log(date2); // -> Wed Dec 12 2012 00:00:00 GMT+0300 
 
 
var date1 = new Date(2012,11,12,8,35);
// the copy parameter is set to true, the date will be copied
// so the date passed as a 1st parameter won't be modified
var date2 = webix.Date.datePart(date1,true);
 
console.log(date1); // -> Wed Dec 12 2012 08:35:00 GMT+0300 
console.log(date2); // -> Wed Dec 12 2012 00:00:00 GMT+0300

See also
Back to top