@bxshefby/b24jssdk
Version:
Bitrix24 REST API JavaScript SDK
35 lines (31 loc) • 930 B
JavaScript
/**
* @package @bxshefby/b24jssdk
* @version 3.3.0
* @copyright (c) 2026 Bitrix24
* @license MIT
* @see https://github.com/bx-shef/b24-js-sdk
* @see https://b24-js-sdk.bx-shef.by/
*/
;
const dateFormat = require('./date-format.cjs');
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
class AbstractFormatter {
static {
__name(this, "AbstractFormatter");
}
dateFormat;
constructor(dateFormat = "YYYY-MM-DD HH:mm:ss") {
this.dateFormat = dateFormat;
}
_formatTimestamp(date) {
return Math.floor((date instanceof Date ? date.getTime() : Number.NaN) / 1e3).toFixed(0);
}
_formatDate(date) {
return dateFormat.formatDate(
date,
this.dateFormat.replace(/YYYY/g, "yyyy").replace(/YY/g, "yy").replace(/DD/g, "dd").replace(/D/g, "d")
);
}
}
exports.AbstractFormatter = AbstractFormatter;