jsdav-ext
Version:
jsDAV allows you to easily add WebDAV support to a NodeJS application. jsDAV is meant to cover the entire standard, and attempts to allow integration using an easy to understand API.
29 lines (24 loc) • 854 B
JavaScript
/*
* @package jsDAV
* @subpackage VObject
* @copyright Copyright(c) 2013 Mike de Boer. <info AT mikedeboer DOT nl>
* @author Oleg Elifantiev <oleg@elifantiev.ru>
* @license http://github.com/mikedeboer/jsDAV/blob/master/LICENSE MIT License
*/
var moment = require('moment');
var jsVObject_DateTimeParser = module.exports = {
parseDateTime: function(str) {
if(str[str.length-1] == "Z"){
return moment.utc(str.substring(0, str.length-1), "YYYYMMDDTHHmm00").local()
}else{
return moment(str, "YYYYMMDDTHHmm00");
}
},
parse: function(str, reftz) {
if(str[str.length-1] == "Z"){
return moment.utc(str.substring(0, str.length-1), "YYYYMMDDTHHmm00").local()
}else{
return moment(str, "YYYYMMDDTHHmm00");
}
}
};