Initalize
This commit is contained in:
27
node_modules/timeago.js/esm/utils/dom.js
generated
vendored
Normal file
27
node_modules/timeago.js/esm/utils/dom.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
var ATTR_TIMEAGO_TID = 'timeago-id';
|
||||
/**
|
||||
* get the datetime attribute, `datetime` are supported.
|
||||
* @param node
|
||||
* @returns {*}
|
||||
*/
|
||||
export function getDateAttribute(node) {
|
||||
return node.getAttribute('datetime');
|
||||
}
|
||||
/**
|
||||
* set the node attribute, native DOM
|
||||
* @param node
|
||||
* @param timerId
|
||||
* @returns {*}
|
||||
*/
|
||||
export function setTimerId(node, timerId) {
|
||||
// @ts-ignore
|
||||
node.setAttribute(ATTR_TIMEAGO_TID, timerId);
|
||||
}
|
||||
/**
|
||||
* get the timer id
|
||||
* @param node
|
||||
*/
|
||||
export function getTimerId(node) {
|
||||
return parseInt(node.getAttribute(ATTR_TIMEAGO_TID));
|
||||
}
|
||||
//# sourceMappingURL=dom.js.map
|
||||
Reference in New Issue
Block a user