mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 23:04:04 +00:00
Removing console log and approx sign
This commit is contained in:
parent
2438e87efa
commit
b000c1d532
1 changed files with 2 additions and 8 deletions
|
@ -235,15 +235,10 @@ class RelativeTimeFormatter {
|
||||||
/**
|
/**
|
||||||
* Method to update the instance locale and options
|
* Method to update the instance locale and options
|
||||||
* @param {string} locale Localization identifier (e.g., "en", "ar-sy") to update the instance with.
|
* @param {string} locale Localization identifier (e.g., "en", "ar-sy") to update the instance with.
|
||||||
* @param {object} options Instance options to be passed.
|
|
||||||
* @returns {void} No return value.
|
* @returns {void} No return value.
|
||||||
*/
|
*/
|
||||||
updateLocale(locale, options = {}) {
|
updateLocale(locale) {
|
||||||
this.locale = locale;
|
this.locale = locale;
|
||||||
this.options = {
|
|
||||||
...this.options,
|
|
||||||
...options,
|
|
||||||
};
|
|
||||||
this.rtf = new Intl.RelativeTimeFormat(this.locale, this.options);
|
this.rtf = new Intl.RelativeTimeFormat(this.locale, this.options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,7 +261,6 @@ class RelativeTimeFormatter {
|
||||||
*/
|
*/
|
||||||
const toFormattedPart = (value, unitOfTime) => {
|
const toFormattedPart = (value, unitOfTime) => {
|
||||||
const res = this.getInstance().formatToParts(value, unitOfTime);
|
const res = this.getInstance().formatToParts(value, unitOfTime);
|
||||||
console.log(res);
|
|
||||||
let formattedString = res
|
let formattedString = res
|
||||||
.map((part, _idx) => {
|
.map((part, _idx) => {
|
||||||
if (
|
if (
|
||||||
|
@ -297,7 +291,7 @@ class RelativeTimeFormatter {
|
||||||
|
|
||||||
const result =
|
const result =
|
||||||
parts.length > 0
|
parts.length > 0
|
||||||
? `~ ${parts.join(" ")}`
|
? `${parts.join(" ")}`
|
||||||
: this.getInstance().format(0, "second"); // Handle case for 0 seconds
|
: this.getInstance().format(0, "second"); // Handle case for 0 seconds
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in a new issue