diff --git a/examples/_data.ts b/examples/_data.ts index 5a81c7134..2bcf21b25 100644 --- a/examples/_data.ts +++ b/examples/_data.ts @@ -166,6 +166,11 @@ export const sidebar = [ "https://www.youtube.com/watch?v=oxVwTT-rZRo&list=PLvvLnBDNuTEov9EBIp3MMfHlBxaKGRWTe&index=6", type: "video", }, + { + title: "Temporal API", + href: "/examples/temporal/", + type: "example", + }, { title: "Better debugging with the console API", href: "/examples/debugging_with_console_tutorial/", @@ -1077,11 +1082,6 @@ export const sidebar = [ href: "/examples/udp_connector/", type: "example", }, - { - title: "Temporal API", - href: "/examples/temporal/", - type: "example", - }, { title: "Importing text", href: "/examples/importing_text/", diff --git a/examples/scripts/temporal.ts b/examples/scripts/temporal.ts index 4ae545e7e..6815f2406 100644 --- a/examples/scripts/temporal.ts +++ b/examples/scripts/temporal.ts @@ -2,10 +2,10 @@ * @title Temporal API * @difficulty beginner * @tags cli - * @run --unstable-temporal + * @run * @resource {https://docs.deno.com/api/web/~/Temporal} Temporal API reference documentation * @resource {https://tc39.es/proposal-temporal/docs} Temporal API proposal documentation - * @group Unstable APIs + * @group Web APIs */ // Get the current date diff --git a/runtime/reference/cli/unstable_flags.md b/runtime/reference/cli/unstable_flags.md index 66ed7e249..a43dc9425 100644 --- a/runtime/reference/cli/unstable_flags.md +++ b/runtime/reference/cli/unstable_flags.md @@ -236,28 +236,20 @@ Please use these feature flags instead moving forward. ## `--unstable-temporal` -Enable the experimental [Temporal API](https://tc39.es/proposal-temporal/docs/) -in the global scope. The Temporal API is a modern date and time API that is -being developed as a replacement for the legacy `Date` object in JavaScript. It -provides better support for time zones, calendars, and more precise date/time -calculations. +:::note -To use the Temporal API in your Deno program, run it with the flag: +As of Deno 2.7, the Temporal API is **stable** and available by default. The +`--unstable-temporal` flag is no longer required. -```sh -deno run --unstable-temporal your_script.ts -``` +::: -Or configure it in your `deno.json`: - -```json title="deno.json" -{ - "unstable": ["temporal"] -} -``` +The [Temporal API](https://tc39.es/proposal-temporal/docs/) is a modern date and +time API available in the global scope. It provides better support for time +zones, calendars, and more precise date/time calculations than the legacy `Date` +object. ```ts title="example.ts" -// Example using Temporal API +// Get the current date and time const now = Temporal.Now.plainDateTimeISO(); console.log(`Current date and time: ${now}`); @@ -269,7 +261,3 @@ console.log(`Next week: ${nextWeek}`); const zonedDateTime = Temporal.Now.zonedDateTimeISO("America/New_York"); console.log(`Time in New York: ${zonedDateTime}`); ``` - -Note that the Temporal API is still experimental and the specification may -change before it becomes stable. Use this flag only for testing and -experimentation.