@tduniec/backstage-plugin-time-saver
Version:
This plugin provides an implementation of charts and statistics related to your time savings that are coming from usage of your templates. Plugins is built from frontend and backend part. This part of plugin `frontend` is responsible of providing views wi
20 lines (18 loc) • 579 B
JavaScript
function getRandomColor() {
const letters = "0123456789ABCDEF";
let color = "#";
for (let i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * 16)];
}
return color;
}
function createUrlWithDates(url, dates) {
if (!dates) return url;
const [start, end] = dates;
const parsedUrl = new URL(url);
if (start) parsedUrl.searchParams.append("start", start.toISODate());
if (end) parsedUrl.searchParams.set("end", end.toISODate());
return parsedUrl.toString();
}
export { createUrlWithDates, getRandomColor };
//# sourceMappingURL=utils.esm.js.map