Bläddra i källkod

Fixed corn parser date and added UTC time disclaimer to cron description

jnfrati 4 år sedan
förälder
incheckning
11b0a58923

+ 2 - 1
dashboard/src/components/porter-form/field-components/CronInput.tsx

@@ -69,7 +69,8 @@ const CronInput: React.FC<CronField> = (props) => {
             {CronParser.toString(variables[variable], {
               throwExceptionOnParseError: false,
               verbose: true,
-            })}
+            })}{" "}
+            UTC
           </>
         )}
       </Label>

+ 1 - 1
dashboard/src/main/home/cluster-dashboard/chart/Chart.tsx

@@ -106,7 +106,7 @@ const Chart: React.FunctionComponent<Props> = ({
   let interval = null;
   if (chart?.config?.schedule?.enabled) {
     interval = CronParser.parseExpression(chart?.config?.schedule.value, {
-      currentDate: new Date(),
+      utc: true,
     });
   }
 

+ 2 - 2
dashboard/src/main/home/cluster-dashboard/chart/ChartList.tsx

@@ -374,7 +374,7 @@ const ChartList: React.FunctionComponent<Props> = ({
           firstInterval = CronParser.parseExpression(
             a?.config?.schedule.value,
             {
-              currentDate: new Date(),
+              utc: true,
             }
           );
         }
@@ -384,7 +384,7 @@ const ChartList: React.FunctionComponent<Props> = ({
           secondInterval = CronParser.parseExpression(
             b?.config?.schedule.value,
             {
-              currentDate: new Date(),
+              utc: true,
             }
           );
         }

+ 3 - 2
dashboard/src/main/home/cluster-dashboard/expanded-chart/ExpandedJobChart.tsx

@@ -136,7 +136,7 @@ export const ExpandedJobChartFC: React.FC<{
     let interval = null;
     if (chart?.config?.schedule.enabled) {
       interval = CronParser.parseExpression(chart?.config?.schedule.value, {
-        currentDate: new Date(),
+        utc: true,
       });
     }
     // @ts-ignore
@@ -184,7 +184,8 @@ export const ExpandedJobChartFC: React.FC<{
               Runs{" "}
               {CronPrettifier.toString(
                 chart?.config?.schedule.value
-              ).toLowerCase()}
+              ).toLowerCase()}{" "}
+              UTC
               <Dot
                 style={{
                   color: "#ffffff88",