bito-code-review[bot] commented on code in PR #37923:
URL: https://github.com/apache/superset/pull/37923#discussion_r2796608476


##########
superset-frontend/packages/superset-ui-core/src/utils/dates.ts:
##########
@@ -40,8 +40,29 @@ dayjs.updateLocale('en', {
   invalidDate: 'Invalid date',
 });
 
-export const extendedDayjs = dayjs;
-export type { Dayjs };
+// Extended Dayjs instance type with plugin methods
+export interface ExtendedDayjs extends Dayjs {
+  utc(keepLocalTime?: boolean): ExtendedDayjs;
+  local(): ExtendedDayjs;
+  tz(timezone?: string, keepLocalTime?: boolean): ExtendedDayjs;
+  fromNow(withoutSuffix?: boolean): string;
+  toNow(withoutSuffix?: boolean): string;
+}
+
+// Type for dayjs factory with all plugins loaded
+type DayjsWithPlugins = {
+  (config?: ConfigType, format?: string): ExtendedDayjs;
+  utc(config?: ConfigType, format?: string): ExtendedDayjs;
+  tz: {
+    (input?: ConfigType, timezone?: string): ExtendedDayjs;

Review Comment:
   <!-- Bito Reply -->
   This change extends the Dayjs type with an ExtendedDayjs interface that 
includes plugin methods (utc, local, isUTC, tz, fromNow, toNow, from, to, 
calendar), ensuring methods returning Dayjs instances now return ExtendedDayjs 
for proper type-safe chaining. It adds missing methods like isUTC, from, to, 
and calendar, and updates the export to use a typed factory for full plugin 
support.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to