mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-23 09:23:48 +01:00
Show current date filter value
This commit is contained in:
parent
06ad3eeff1
commit
24d380d37e
@ -508,6 +508,18 @@ export function inputNumber(props: {
|
||||
});
|
||||
}
|
||||
|
||||
function formatDate(date?) {
|
||||
if (date === null || date === undefined)
|
||||
return undefined;
|
||||
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
const localDate = `${year}-${month}-${day}`;
|
||||
return localDate;
|
||||
}
|
||||
|
||||
|
||||
export function inputDate(props: {
|
||||
title?: string | null;
|
||||
text?: string | null;
|
||||
@ -529,7 +541,7 @@ export function inputDate(props: {
|
||||
input: {
|
||||
type: "date",
|
||||
placeholder: props.placeholder,
|
||||
default: props.default,
|
||||
default: formatDate(props.default),
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -215,6 +215,7 @@ function saveSrc(
|
||||
async function timetravel(): Promise<void> {
|
||||
const { canceled, result: date } = await os.inputDate({
|
||||
title: i18n.ts.date,
|
||||
default: untilDate != undefined ? new Date(untilDate) : new Date(),
|
||||
});
|
||||
if (canceled || isNaN(date.getTime())) return;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
const chalk = require("chalk");
|
||||
|
||||
console.log(chalk.magenta(" ______ __ ____ "));
|
||||
console.log(chalk.magenta(" /_ __/________ ______/ /_ / __ \____ __________"));
|
||||
console.log(chalk.magenta(" / / / ___/ __ `/ ___/ __ \/ /_/ / __ \/ ___/ ___/"));
|
||||
console.log(chalk.magenta(" /_ __/________ ______/ /_ / __ \\____ __________"));
|
||||
console.log(chalk.magenta(" / / / ___/ __ `/ ___/ __ \\/ /_/ / __ \\/ ___/ ___/"));
|
||||
console.log(chalk.magenta(" / / / / / /_/ (__ ) / / / ____/ /_/ (__ |__ ) "));
|
||||
console.log(chalk.magenta("/_/ /_/ \__,_/____/_/ /_/_/ \____/____/____/ "));
|
||||
console.log(chalk.magenta("/_/ /_/ \\__,_/____/_/ /_/_/ \\____/____/____/ "));
|
||||
console.log(chalk.magenta(" "));
|
||||
|
||||
console.log(chalk.magenta("Currently building TrashPoss!"));
|
||||
|
Loading…
Reference in New Issue
Block a user