Files
Your Name 38652eb9b5 Initalize
2026-05-03 12:12:57 -04:00

32 lines
763 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var ATTR_TIMEAGO_TID = 'timeago-id';
/**
* get the datetime attribute, `datetime` are supported.
* @param node
* @returns {*}
*/
function getDateAttribute(node) {
return node.getAttribute('datetime');
}
exports.getDateAttribute = getDateAttribute;
/**
* set the node attribute, native DOM
* @param node
* @param timerId
* @returns {*}
*/
function setTimerId(node, timerId) {
// @ts-ignore
node.setAttribute(ATTR_TIMEAGO_TID, timerId);
}
exports.setTimerId = setTimerId;
/**
* get the timer id
* @param node
*/
function getTimerId(node) {
return parseInt(node.getAttribute(ATTR_TIMEAGO_TID));
}
exports.getTimerId = getTimerId;
//# sourceMappingURL=dom.js.map