fix: timezone count (#4604)

* fix: timezone count

* fix: ts

* fix: test llm
This commit is contained in:
Archer
2025-04-20 22:24:03 +08:00
committed by GitHub
parent 61aa91b3aa
commit 4ac2a2f43e
10 changed files with 73 additions and 50 deletions

View File

@@ -30,7 +30,7 @@ export const getTimezoneOffset = (timeZone: string): number => {
*
* Generated by Trelent
*/
export const timezoneList = () => {
export const getTimeZoneList = () => {
const result = timezones
.map((timezone) => {
try {
@@ -71,6 +71,23 @@ export const timezoneList = () => {
time: number;
}[];
};
export const timeZoneList = getTimeZoneList();
export const getMongoTimezoneCode = (timeString: string) => {
if (!timeString.includes(':')) {
return '+00:00';
}
if (timeString.includes('+')) {
const timezoneMatch = timeString.split('+');
return `+${timezoneMatch[1]}`;
} else if (timeString.includes('-')) {
const timezoneMatch = timeString.split('-');
return `-${timezoneMatch[1]}`;
} else {
return '+00:00';
}
};
export const getSystemTime = (timeZone: string) => {
const timezoneDiff = getTimezoneOffset(timeZone);

View File

@@ -7,8 +7,8 @@ export type CreateTrainingUsageProps = {
};
export type GetUsageProps = {
dateStart: Date;
dateEnd: Date;
dateStart: string;
dateEnd: string;
sources?: UsageSourceEnum[];
teamMemberIds?: string[];
projectName?: string;