Browse Source

Updated the TypeScript typings

main
Cédric Belin 1 week ago
parent
commit
2d90e6b9fb
2 changed files with 27 additions and 1 deletions
  1. +26
    -0
      lib/js/index.d.ts
  2. +1
    -1
      src/gitea/DateTools.hx

+ 26
- 0
lib/js/index.d.ts View File

@@ -64,6 +64,32 @@ export declare namespace organization {
}

export declare namespace repository {
export class ExternalTracker {
format: string;
style: string;
url: string;
constructor(data?: Record<string, string>);
}

export class ExternalWiki {
url: string;
constructor(data?: Record<string, string>);
}

export class InternalTracker {
allowOnlyContributorsToTrackTime: boolean;
enableIssueDependencies: boolean;
enableTimeTracker: boolean;
constructor(data?: Record<string, boolean>);
}

export class Permission {
admin: boolean;
pull: boolean;
push: boolean;
constructor(data?: Record<string, boolean>);
}

// TODO
}



+ 1
- 1
src/gitea/DateTools.hx View File

@@ -38,7 +38,7 @@ class DateTools {
if (!validateTimeZone(tz[0], tz[1])) return null;

final offset = Math.abs(tz[0] * 3600) + (tz[1] * 60);
final timestamp = DateTime.make(date[0], date[1], date[2], time[0], time[1], time[2]).getTime() + (tz[0] < 0 ? offset : -offset);
final timestamp = DateTime.make(date[0], date[1], date[2], time[0], time[1], time[2]).getTime() + (tz[0] <= 0 ? offset : -offset);
return Date.fromTime(timestamp * 1000);
#end
}


Loading…
Cancel
Save