new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Nuxt · API · all subjects

components/nuxttime

11 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

NuxtTime component minimal version

The <NuxtTime> component is available in Nuxt v3.17 and later.

NuxtTime component purpose

The <NuxtTime> component displays dates and times in a locale-friendly format with proper <time> HTML semantics. It ensures consistent rendering between server and client without hydration mismatches.

NuxtTime datetime prop

The datetime prop is required and accepts a Date object, a timestamp (number), or an ISO-formatted date string.

NuxtTime locale prop

The locale prop is optional (default: uses the browser or server's default locale) and accepts a BCP 47 language tag string such as 'en-US', 'fr-FR', or 'ja-JP' for formatting.

NuxtTime formatting props

The component accepts any property from the Intl.DateTimeFormat options for custom formatting, including year, month, day, hour, minute, second, weekday, and timeZoneName.

NuxtTime relative prop

The relative prop is optional (default: false) and accepts a boolean. When set to true, it enables relative time formatting using the Intl.RelativeTimeFormat API, displaying output like '5 minutes ago' or 'in 2 days'.

NuxtTime relative time formatting props

When relative is set to true, the component accepts properties from Intl.RelativeTimeFormat including numeric and relativeStyle. The relativeStyle prop is used instead of the reserved style prop.

NuxtTime basic usage example

Basic usage displays the current time: <template>\n <NuxtTime :datetime="Date.now()" />\n</template>

NuxtTime custom formatting example

Custom formatting example with multiple format options: <template>\n <NuxtTime\n :datetime="Date.now()"\n weekday="long"\n year="numeric"\n month="short"\n day="numeric"\n hour="numeric"\n minute="numeric"\n second="numeric"\n time-zone-name="short"\n />\n</template>

NuxtTime relative time example

Relative time formatting example: <template>\n <div>\n <p>\n <NuxtTime\n :datetime="Date.now() - 30 * 1000"\n relative\n />\n <!-- 30 seconds ago -->\n </p>\n <p>\n <NuxtTime\n :datetime="Date.now() - 45 * 60 * 1000"\n relative\n />\n <!-- 45 minutes ago -->\n </p>\n <p>\n <NuxtTime\n :datetime="Date.now() + 2 * 24 * 60 * 60 * 1000"\n relative\n />\n <!-- in 2 days -->\n </p>\n </div>\n</template>

NuxtTime locale comparison example

Multiple locale example formatting the same time in different locales: <template>\n <div>\n <NuxtTime\n :datetime="Date.now()"\n locale="en-US"\n weekday="long"\n />\n <NuxtTime\n :datetime="Date.now()"\n locale="fr-FR"\n weekday="long"\n />\n <NuxtTime\n :datetime="Date.now()"\n locale="ja-JP"\n weekday="long"\n />\n </div>\n</template>

Give your agent this brain