Date constructor

Date details appear here.

Error constructor

Throw a new Error when input is empty. Catch it and show the message.

Enter a note or leave it blank to trigger an Error.

Important JavaScript

const now = new Date();
now.getFullYear();
now.toISOString();

const stamped = new Date("2026-09-11T09:00:00");

try {
  if (!text) {
    throw new Error("Note is required.");
  }
} catch (error) {
  status.textContent = error.message;
}