DocSpace-client/packages/shared/components/cron
Viktor Fomin 7227b1d35e Fix Bug 68933
Can't see the last rows in the Sync LDAP data drop down lists
2024-06-30 14:47:56 +03:00
..
sub-components Fix Bug 68933 2024-06-30 14:47:56 +03:00
Cron.constants.ts Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
Cron.part.ts Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
Cron.stories.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
Cron.styled.ts Client: Login: DocEditor Remove increasing value for RTL 2024-04-17 10:55:33 +02:00
Cron.test.tsx Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
Cron.tsx LDAP: Fix block UI on operation begin 2024-06-05 15:22:27 +04:00
Cron.types.ts LDAP: Fix block UI on operation begin 2024-06-05 15:22:27 +04:00
Cron.utils.ts Translations: Fix EnDublicatesByContentTest issue (replaced GroupsNotFoundHeader to NotFoundGroups) 2024-04-11 12:51:03 +04:00
index.ts Replaced copyright start year + format 2024-03-21 18:09:55 +04:00
README.md Shared:Components:Cron Added README 2023-12-21 16:12:45 +05:00

Cron

The Cron component provides an interface for working with cron expressions.

Properties

Property Type Required Default Description
value string No "* * * * *" Current cron expression value.
setValue (value: string) => void Yes - Function to set a new cron expression value, similar to onChange.
onError (error?: Error) => void No - Callback function triggered when an error is detected with the value.

Property value

  • Type: string
  • Description: The current cron expression value. If not specified, the component will display the default value.

Property setValue

  • Type: (value: string) => void
  • Description: Function to set a new cron expression value. Called when the component's value changes, similar to the onChange event.

Property onError

  • Type: (error?: Error) => void
  • Description: Callback function triggered when an error is detected with the cron expression value. If specified, the component will pass error information to this function.

Usage Example

import React from "react";
import Cron from "@docspace/shared/components";

const Component = () => {
  const handleCronChange = (newCronValue) => {
    console.log("New cron value:", newCronValue);
  };

  const handleCronError = (error) => {
    console.error("Cron error:", error);
  };

  return (
    <Cron
      value="*5 * * * *"
      setValue={handleCronChange}
      onError={handleCronError}
    />
  );
};

export default Component;