Versions

  • v2

    10/6/2024
    Open: Version
    Changes from v1 to v2
    +73
    -73
    export default async function (req: Request): Promise<Response> {
    const now = new Date();
    const hours = now.getHours().toString().padStart(2, '0');
    const minutes = now.getMinutes().toString().padStart(2, '0');
    const time = `${hours}:${minutes}`;

    ⦚ 7 unchanged lines ⦚
    function generateTimeAsciiArt(time: string): string {
    const digits = {
    '0': [
    ' ███ ',
    '█ █',
    '█ █',
    '█ █',
    ' ███ '
    ],
    '1': [
    '',
    ' ██ ',
    '',
    '',
    ' ███ '
    ],
    '2': [
    ' ███ ',
    '',
    ' ███ ',
    '',
    '█████'
    ],
    '3': [
    ' ███ ',
    '',
    ' ███ ',
    '',
    export default async function(req: Request): Promise<Response> {
    const now = new Date();
    const hours = now.getHours().toString().padStart(2, "0");
    const minutes = now.getMinutes().toString().padStart(2, "0");
    const time = `${hours}:${minutes}`;

    ⦚ 7 unchanged lines ⦚
    function generateTimeAsciiArt(time: string): string {
    const digits = {
    "0": [
    " ███ ",
    "█ █",
    "█ █",
    "█ █",
    " ███ ",
    ],
    "1": [
    "",
    " ██ ",
    "",
    "",
    " ███ ",
    ],
    "2": [
    " ███ ",
    "",
    " ███ ",
    "",
    "█████",
    ],
    "3": [
    " ███ ",
    "",
    " ███ ",
    "",
  • v1

    10/6/2024
    Open: Version
    Changes from v0 to v1
    +98
    -7
    export default async function (req: Request): Promise<Response> {
    const asciiArt = `
    _ _ _ _ __ __ _ _ _
    | | | | ___| | | ___ \\ \\ / /__ _ __| | __| | |
    | |_| |/ _ \\ | |/ _ \\ \\ \\ /\\ / / _ \\| '__| |/ _\` | |
    | _ | __/ | | (_) | \\ V V / (_) | | | | (_| |_|
    |_| |_|\\___|_|_|\\___/ \\_/\\_/ \\___/|_| |_|\\__,_(_)
    `;

    return new Response(asciiArt, {
    headers: { "Content-Type": "text/plain" },
    });
    }
    export default async function (req: Request): Promise<Response> {
    const now = new Date();
    const hours = now.getHours().toString().padStart(2, '0');
    const minutes = now.getMinutes().toString().padStart(2, '0');
    const time = `${hours}:${minutes}`;

    const asciiArt = generateTimeAsciiArt(time);

    return new Response(asciiArt, {
    headers: { "Content-Type": "text/plain" },
    });
    }

    function generateTimeAsciiArt(time: string): string {
    const digits = {
    '0': [
    ' ███ ',
    '█ █',
    '█ █',
    '█ █',
    ' ███ '
    ],
    '1': [
    ' █ ',
    ' ██ ',
    ' █ ',
    ' █ ',
    ' ███ '
    ],
    '2': [
    ' ███ ',
    ' █',
    ' ███ ',
    '█ ',
    '█████'
    ],
  • v0

    10/6/2024
    Open: Version
    +13
    -0

    export default async function (req: Request): Promise<Response> {
    const asciiArt = `
    _ _ _ _ __ __ _ _ _
    | | | | ___| | | ___ \\ \\ / /__ _ __| | __| | |
    | |_| |/ _ \\ | |/ _ \\ \\ \\ /\\ / / _ \\| '__| |/ _\` | |
    | _ | __/ | | (_) | \\ V V / (_) | | | | (_| |_|
    |_| |_|\\___|_|_|\\___/ \\_/\\_/ \\___/|_| |_|\\__,_(_)
    `;

    return new Response(asciiArt, {
    headers: { "Content-Type": "text/plain" },
    });
    }
1
Next
rozek-gdi_servertimeservice.web.val.run
Updated: October 6, 2024