snapshot of https://github.com/RocketChat/Rocket.Chat.git (develop, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Create issues from TODOs / todos (push) Failing after 3s
Close inactive issues / close-issues (push) Has been cancelled
Deploy GitHub Pages / deploy-preview (push) Has been cancelled
CI / ⚙️ Variables Setup (push) Has been cancelled
CI / ⚙️ Test Guard (push) Has been cancelled
CI / 🚀 Notify external services - draft (push) Has been cancelled
CI / 📦 Build Packages (push) Has been cancelled
CI / 📦 Meteor Build (coverage) (push) Has been cancelled
CI / 📦 Meteor Build (production) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [account-service presence-service omnichannel-transcript-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [authorization-service queue-worker-service ddp-streamer-service], fips) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Build Docker (amd64, [rocketchat], fips) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [account-service presence-service omnichannel-transcript-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [authorization-service queue-worker-service ddp-streamer-service], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], ${{ (github.event_name != 'release' && github.ref != 'refs/heads/develop') && 'coverage' || 'production' }}) (push) Has been cancelled
CI / 🚢 Build Docker (arm64, [rocketchat], coverage) (push) Has been cancelled
CI / 🚢 Publish Docker Images (ghcr.io) (push) Has been cancelled
CI / 📦 Track Image Sizes (push) Has been cancelled
CI / 🔎 Code Check - Action Lint (push) Has been cancelled
CI / 🔎 Code Check (push) Has been cancelled
CI / 🔨 Test Storybook (push) Has been cancelled
CI / 🔨 Test Unit (push) Has been cancelled
CI / 🔨 Test API (CE) (push) Has been cancelled
CI / 🔨 Test API Livechat (CE) (push) Has been cancelled
CI / 🔨 Test UI (CE) (push) Has been cancelled
CI / 🔨 Test API (EE) (push) Has been cancelled
CI / 🔨 Test API Livechat (EE) (push) Has been cancelled
CI / 🔨 Test API Apps (deno-runtime - EE) (push) Has been cancelled
CI / 🔨 Test UI (EE) (push) Has been cancelled
CI / 🔨 Test API (FIPS) (push) Has been cancelled
CI / 🔨 Test API Livechat (FIPS) (push) Has been cancelled
CI / 🔨 Test UI (FIPS) (push) Has been cancelled
CI / 🔨 Test Federation Matrix (push) Has been cancelled
CI / 📊 Report Coverage (push) Has been cancelled
CI / ✅ Tests Done (push) Has been cancelled
CI / 🚀 Publish build assets (push) Has been cancelled
CI / 🚀 Publish Docker Images (DockerHub) (push) Has been cancelled
CI / 🚀 Notify external services (push) Has been cancelled
CI / Update Version Durability (push) Has been cancelled
Release / Release (push) Has been cancelled
Auto-close duplicate issues / auto-close-duplicates (push) Failing after 1s
Code scanning - action / CodeQL-Build (push) Failing after 1s

This commit is contained in:
upstream-mirror
2026-09-16 01:21:02 +05:00
commit 30810eecd7
10161 changed files with 987110 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import { UTCOffsets, type TimestampFormat, type TimezoneKey } from './types';
export const dateToISOString = (date: Date, timezone?: TimezoneKey): string => {
if (!date || isNaN(date.getTime())) {
return '';
}
if (timezone && timezone !== 'local') {
const offset = UTCOffsets[timezone];
if (offset) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
const ms = String(date.getMilliseconds()).padStart(3, '0');
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}.${ms}${offset}`;
}
}
return date.toISOString().replace('Z', '+00:00');
};
/**
* Generates a timestamp markup string in the format <t:timestamp:format>
*/
export const generateTimestampMarkup = (timestamp: string, format: TimestampFormat): string => {
return `<t:${timestamp}:${format}>`;
};

View File

@@ -0,0 +1,39 @@
import type { TimestampFormat, ITimestampFormatConfig } from './types';
export const TIMESTAMP_FORMATS: Record<TimestampFormat, ITimestampFormatConfig> = {
t: {
label: 'timestamps.shortTime',
format: 'p',
description: 'timestamps.shortTimeDescription',
},
T: {
label: 'timestamps.longTime',
format: 'pp',
description: 'timestamps.longTimeDescription',
},
d: {
label: 'timestamps.shortDate',
format: 'P',
description: 'timestamps.shortDateDescription',
},
D: {
label: 'timestamps.longDate',
format: 'Pp',
description: 'timestamps.longDateDescription',
},
f: {
label: 'timestamps.fullDateTime',
format: 'PPPP p',
description: 'timestamps.fullDateTimeDescription',
},
F: {
label: 'timestamps.fullDateTimeLong',
format: 'PPPP pp',
description: 'timestamps.fullDateTimeLongDescription',
},
R: {
label: 'timestamps.relativeTime',
format: 'relative',
description: 'timestamps.relativeTimeDescription',
},
};

View File

@@ -0,0 +1,37 @@
export type TimestampFormat = 't' | 'T' | 'd' | 'D' | 'f' | 'F' | 'R';
export interface ITimestampFormatConfig {
label: string;
format: string;
description: string;
}
export enum UTCOffsets {
'UTC-12' = '-12:00',
'UTC-11' = '-11:00',
'UTC-10' = '-10:00',
'UTC-9' = '-09:00',
'UTC-8' = '-08:00',
'UTC-7' = '-07:00',
'UTC-6' = '-06:00',
'UTC-5' = '-05:00',
'UTC-4' = '-04:00',
'UTC-3' = '-03:00',
'UTC-2' = '-02:00',
'UTC-1' = '-01:00',
'UTC' = '+00:00',
'UTC+1' = '+01:00',
'UTC+2' = '+02:00',
'UTC+3' = '+03:00',
'UTC+4' = '+04:00',
'UTC+5' = '+05:00',
'UTC+6' = '+06:00',
'UTC+7' = '+07:00',
'UTC+8' = '+08:00',
'UTC+9' = '+09:00',
'UTC+10' = '+10:00',
'UTC+11' = '+11:00',
'UTC+12' = '+12:00',
}
export type TimezoneKey = keyof typeof UTCOffsets | 'local';