forked from cadence/out-of-your-element
git is being funny again #14
2 changed files with 8 additions and 8 deletions
Fix scheduled event tests
commit
9d7f8888a7
|
|
@ -915,8 +915,8 @@ async function messageToEvent(message, guild, options = {}, di) {
|
||||||
|
|
||||||
// Add time
|
// Add time
|
||||||
if (event.scheduled_end_time) {
|
if (event.scheduled_end_time) {
|
||||||
const formatter = new Intl.DateTimeFormat("en-NZ", {month: "long", day: "numeric", hour: "numeric", minute: "2-digit", timeZoneName: "shortGeneric", timeZone: reg.ooye.time_zone}) // 9 June at 3:00 pm NZT
|
const formatter = new Intl.DateTimeFormat("en-NZ", {weekday: "long", month: "long", day: "numeric", hour: "numeric", minute: "2-digit", timeZone: "UTC"}) // 9 June at 3:00 pm NZT
|
||||||
var displayTime = formatter.formatRange(new Date(event.scheduled_start_time), new Date(event.scheduled_end_time))
|
var displayTime = formatter.formatRange(new Date(event.scheduled_start_time), new Date(event.scheduled_end_time)) + " (UTC)"
|
||||||
} else {
|
} else {
|
||||||
var displayTime = discordTime.convertDiscordTime(unixSeconds, "F")
|
var displayTime = discordTime.convertDiscordTime(unixSeconds, "F")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1589,12 +1589,12 @@ test("message2event: irl invite event renders embed", async t => {
|
||||||
{
|
{
|
||||||
$type: "m.room.message",
|
$type: "m.room.message",
|
||||||
msgtype: "m.notice",
|
msgtype: "m.notice",
|
||||||
body: `| Scheduled Event - 8 June at 10:00 pm NZT – 9 June at 12:00 am NZT`
|
body: `| Scheduled Event - Sunday, 8 June, 10:00 am – 12:00 pm (UTC)`
|
||||||
+ `\n| ## forest exploration`
|
+ `\n| ## forest exploration`
|
||||||
+ `\n| `
|
+ `\n| `
|
||||||
+ `\n| 📍 the dark forest`,
|
+ `\n| 📍 the dark forest`,
|
||||||
format: "org.matrix.custom.html",
|
format: "org.matrix.custom.html",
|
||||||
formatted_body: `<blockquote><p>Scheduled Event - 8 June at 10:00 pm NZT – 9 June at 12:00 am NZT</p>`
|
formatted_body: `<blockquote><p>Scheduled Event - <a href=\"https://bridge.example.org/time/1749376800/F\">Sunday, 8 June, 10:00 am – 12:00 pm (UTC)</a></p>`
|
||||||
+ `<strong>forest exploration</strong>`
|
+ `<strong>forest exploration</strong>`
|
||||||
+ `<p>📍 the dark forest</p></blockquote>`,
|
+ `<p>📍 the dark forest</p></blockquote>`,
|
||||||
"m.mentions": {}
|
"m.mentions": {}
|
||||||
|
|
@ -1622,13 +1622,13 @@ test("message2event: vc invite event renders embed", async t => {
|
||||||
{
|
{
|
||||||
$type: "m.room.message",
|
$type: "m.room.message",
|
||||||
msgtype: "m.notice",
|
msgtype: "m.notice",
|
||||||
body: `| Scheduled Event - 9 June at 3:00 pm NZT`
|
body: `| Scheduled Event - Monday, 9 June 2025 at 3:00 am (UTC)`
|
||||||
+ `\n| ## Cooking (Netrunners)`
|
+ `\n| ## Cooking (Netrunners)`
|
||||||
+ `\n| Short circuited brain interfaces actually just means your brain is medium rare, yum.`
|
+ `\n| Short circuited brain interfaces actually just means your brain is medium rare, yum.`
|
||||||
+ `\n| `
|
+ `\n| `
|
||||||
+ `\n| 🔊 Cooking`,
|
+ `\n| 🔊 Cooking`,
|
||||||
format: "org.matrix.custom.html",
|
format: "org.matrix.custom.html",
|
||||||
formatted_body: `<blockquote><p>Scheduled Event - 9 June at 3:00 pm NZT</p>`
|
formatted_body: `<blockquote><p>Scheduled Event - <a href=\"https://bridge.example.org/time/1749438000/F\">Monday, 9 June 2025 at 3:00 am (UTC)</a></p>`
|
||||||
+ `<strong>Cooking (Netrunners)</strong><br>Short circuited brain interfaces actually just means your brain is medium rare, yum.`
|
+ `<strong>Cooking (Netrunners)</strong><br>Short circuited brain interfaces actually just means your brain is medium rare, yum.`
|
||||||
+ `<p>🔊 Cooking</p></blockquote>`,
|
+ `<p>🔊 Cooking</p></blockquote>`,
|
||||||
"m.mentions": {}
|
"m.mentions": {}
|
||||||
|
|
@ -1664,13 +1664,13 @@ test("message2event: vc invite event renders embed with room link", async t => {
|
||||||
{
|
{
|
||||||
$type: "m.room.message",
|
$type: "m.room.message",
|
||||||
msgtype: "m.notice",
|
msgtype: "m.notice",
|
||||||
body: `| Scheduled Event - 9 June at 3:00 pm NZT`
|
body: `| Scheduled Event - Monday, 9 June 2025 at 3:00 am (UTC)`
|
||||||
+ `\n| ## Cooking (Netrunners)`
|
+ `\n| ## Cooking (Netrunners)`
|
||||||
+ `\n| Short circuited brain interfaces actually just means your brain is medium rare, yum.`
|
+ `\n| Short circuited brain interfaces actually just means your brain is medium rare, yum.`
|
||||||
+ `\n| `
|
+ `\n| `
|
||||||
+ `\n| 🔊 Hey. - https://matrix.to/#/!FuDZhlOAtqswlyxzeR:cadence.moe?via=cadence.moe`,
|
+ `\n| 🔊 Hey. - https://matrix.to/#/!FuDZhlOAtqswlyxzeR:cadence.moe?via=cadence.moe`,
|
||||||
format: "org.matrix.custom.html",
|
format: "org.matrix.custom.html",
|
||||||
formatted_body: `<blockquote><p>Scheduled Event - 9 June at 3:00 pm NZT</p>`
|
formatted_body: `<blockquote><p>Scheduled Event - <a href=\"https://bridge.example.org/time/1749438000/F\">Monday, 9 June 2025 at 3:00 am (UTC)</a></p>`
|
||||||
+ `<strong>Cooking (Netrunners)</strong><br>Short circuited brain interfaces actually just means your brain is medium rare, yum.`
|
+ `<strong>Cooking (Netrunners)</strong><br>Short circuited brain interfaces actually just means your brain is medium rare, yum.`
|
||||||
+ `<p>🔊 Hey. - <a href="https://matrix.to/#/!FuDZhlOAtqswlyxzeR:cadence.moe?via=cadence.moe">Hey.</a></p></blockquote>`,
|
+ `<p>🔊 Hey. - <a href="https://matrix.to/#/!FuDZhlOAtqswlyxzeR:cadence.moe?via=cadence.moe">Hey.</a></p></blockquote>`,
|
||||||
"m.mentions": {}
|
"m.mentions": {}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue