这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@JeanMeijer
Copy link
Collaborator

@JeanMeijer JeanMeijer commented Nov 10, 2025

Description

Briefly describe what you did and why.

Screenshots / Recordings

Add screenshots or recordings here to help reviewers understand your changes.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • UI/UX update
  • Docs update
  • Refactor / Cleanup

Related Areas

  • Authentication
  • Calendar UI
  • Data/API
  • Docs

Testing

  • Manual testing performed
  • Cross-browser testing (if UI changes)
  • Mobile responsiveness verified (if UI changes)

Checklist

  • I’ve read the CONTRIBUTING guide
  • My code works and is understandable and follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in complex areas
  • I have updated the documentation
  • Any dependent changes are merged and published

Notes

(Optional) Add anything else you'd like to share.

By submitting, I confirm I understand and stand behind this code. If AI was used, I’ve reviewed and verified everything myself.


Summary by cubic

Refactored date/time formatting to a single utils module and updated components to use it, improving consistency across timezones, locales, and 12/24-hour formats. Also simplified the current-time indicator API and display.

  • Refactors

    • Added formatTime and format helpers in lib/utils/format with overloads for ZonedDateTime, Instant, PlainTime, and PlainDate.
    • Replaced direct @formkit/tempo usage in DateInput, TimeInput, TimeFormatPicker, and current-time indicator with the new helpers.
    • useCurrentTimeIndicator now returns { position, visible, label } and uses formatTime.
    • DateInput uses Temporal for “this year” checks and the new format helper; TimeFormatPicker uses useMemo for current time.
  • Migration

    • Update consumers of useCurrentTimeIndicator to indicator.position, indicator.visible, and indicator.label.
    • Import and use "@/lib/utils/format" helpers instead of formatting directly in components.

Written for commit 8fbe0f7. Summary will update automatically on new commits.

@vercel
Copy link

vercel bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
analog Ready Ready Preview Comment Nov 13, 2025 1:22am

@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 6 files

Prompt for AI agents (all 2 issues)

Understand the root cause of the following 2 issues and fix them.


<file name="apps/web/src/components/calendar/timeline/time-indicator.tsx">

<violation number="1" location="apps/web/src/components/calendar/timeline/time-indicator.tsx:47">
Rule violated: **Define custom utilities, variants and plugins using v4 directives; use @apply in components**

`z-1000` is a custom Tailwind utility but no `@utility` definition exists, so Tailwind will drop it. Restore the arbitrary value or define the utility via v4 directives to keep the label above surrounding elements.</violation>
</file>

<file name="apps/web/src/lib/utils/format.ts">

<violation number="1" location="apps/web/src/lib/utils/format.ts:66">
`Tempo.format` should use the caller’s time zone when formatting a `Temporal.PlainTime`; hard-coding UTC breaks formatting for non-UTC zones.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

<div className="absolute flex h-4 w-20 items-center justify-end border-r border-transparent">
<p className="z-[1000] pe-2 text-[10px] font-medium text-red-500/80 tabular-nums sm:pe-4 sm:text-xs">
{formattedTime}
<p className="z-1000 pe-2 text-[10px] font-medium text-red-500/80 tabular-nums sm:pe-4 sm:text-xs">
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rule violated: Define custom utilities, variants and plugins using v4 directives; use @apply in components

z-1000 is a custom Tailwind utility but no @utility definition exists, so Tailwind will drop it. Restore the arbitrary value or define the utility via v4 directives to keep the label above surrounding elements.

Prompt for AI agents
Address the following comment on apps/web/src/components/calendar/timeline/time-indicator.tsx at line 47:

<comment>`z-1000` is a custom Tailwind utility but no `@utility` definition exists, so Tailwind will drop it. Restore the arbitrary value or define the utility via v4 directives to keep the label above surrounding elements.</comment>

<file context>
@@ -32,20 +32,20 @@ export function TimeIndicator({ date }: TimeIndicatorProps) {
         &lt;div className=&quot;absolute flex h-4 w-20 items-center justify-end border-r border-transparent&quot;&gt;
-          &lt;p className=&quot;z-[1000] pe-2 text-[10px] font-medium text-red-500/80 tabular-nums sm:pe-4 sm:text-xs&quot;&gt;
-            {formattedTime}
+          &lt;p className=&quot;z-1000 pe-2 text-[10px] font-medium text-red-500/80 tabular-nums sm:pe-4 sm:text-xs&quot;&gt;
+            {indicator.label}
           &lt;/p&gt;
</file context>
Suggested change
<p className="z-1000 pe-2 text-[10px] font-medium text-red-500/80 tabular-nums sm:pe-4 sm:text-xs">
<p className="z-[1000] pe-2 text-[10px] font-medium text-red-500/80 tabular-nums sm:pe-4 sm:text-xs">
Fix with Cubic

@JeanMeijer JeanMeijer changed the title refactor(web): improve formatting functions refactor(web): improve temporal format functions Nov 13, 2025
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@JeanMeijer JeanMeijer merged commit 70bd4af into main Nov 13, 2025
8 checks passed
@JeanMeijer JeanMeijer deleted the refactor/format-date branch November 13, 2025 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants