-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ba8b85
commit 5825ed2
Showing
9 changed files
with
129 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<aside class="bg-yellow-200 p-4 rounded-lg text-slate-800 leading-8 mb-8"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
stroke-width="1.5" | ||
stroke="currentColor" | ||
class="w-6 h-6 inline-block mr-1 relative -top-[0.1em]" | ||
> | ||
<path | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
d="M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z" | ||
/> | ||
</svg> | ||
|
||
<slot /> | ||
</aside> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { offset, applyOffset } from "@formkit/tempo" | ||
|
||
// 💡 Pickup at 9:30 in Europe/Lisbon | ||
|
||
// Notice that the time has no offset, thus it is "local": | ||
const d = "2025-03-25 09:30" | ||
|
||
// Lisbon is at UTC+0: | ||
const lisbonOffset = offset(d, "Europe/Lisbon") | ||
|
||
// Apply the offset to the time: | ||
applyOffset(d, lisbonOffset) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { offset } from "@formkit/tempo" | ||
|
||
const date = new Date() | ||
|
||
// Your browser’s offset to UTC | ||
offset(date) | ||
// Your browser’s offset to Hawaii | ||
offset(date, "Pacific/Honolulu") | ||
// Your Hawaii’s offset to UTC | ||
offset(date, "UTC", "Pacific/Honolulu") | ||
// The offset from London to New York today | ||
offset(date, "Europe/London", "America/New_York") | ||
// The offset from Moscow to Kolkata, India | ||
offset(date, "Europe/Moscow", "Asia/Kolkata") | ||
|
||
// 👀 Dates matter due to DST: | ||
offset("2023-10-25", "Europe/London", "America/New_York") | ||
offset("2023-10-30", "Europe/London", "America/New_York") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { format, offset, removeOffset } from "@formkit/tempo" | ||
|
||
// rendered at: | ||
const d = new Date() | ||
|
||
// local time: | ||
format(d, "HH:mm") | ||
|
||
const offsetToBerlin = offset(d, "Europe/Berlin") | ||
const adjusted = removeOffset(d, offsetToBerlin) | ||
// The time in Berlin | ||
format(adjusted, "HH:mm") |