@bloxbean/yaci-viewer
Version:
A Cardano blockchain data viewer for developers. It works with the Yaci-Store backend, supporting both a local devnet and public networks.
25 lines (23 loc) • 805 B
JavaScript
function truncate(fullStr, strLen, separator) {
if (!fullStr) return "";
if (fullStr.length <= strLen) return fullStr;
separator = separator || "...";
var sepLen = separator.length, charsToShow = strLen - sepLen, frontChars = Math.ceil(charsToShow / 2), backChars = Math.floor(charsToShow / 2);
return fullStr.substr(0, frontChars) + separator + fullStr.substr(fullStr.length - backChars);
}
function getDate(blockTime) {
if (!blockTime) return "";
const date = new Date(blockTime * 1e3);
const options = {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
second: "numeric",
hour12: false
};
return date.toLocaleString(void 0, options);
}
export { getDate as g, truncate as t };
//# sourceMappingURL=util-C18qA3ke.js.map