Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time selector should fetch its options from BE #64

Open
ivalime opened this issue Jan 23, 2025 · 0 comments
Open

Time selector should fetch its options from BE #64

ivalime opened this issue Jan 23, 2025 · 0 comments

Comments

@ivalime
Copy link
Collaborator

ivalime commented Jan 23, 2025

There should be a single place where these values are defined/changed instead of being defined on both FE and BE

	switch frequency {
	case "5-minutely":
		return "*/5 * * * *"
	case "hourly":
		return fmt.Sprintf("%d * * * *", startTime.Minute())
	case "daily":
		return fmt.Sprintf("%d %d * * *", startTime.Minute(), startTime.Hour())
	case "weekly":
		return fmt.Sprintf("%d %d * * %d", startTime.Minute(), startTime.Hour(), startTime.Weekday())
	case "monthly":
		return fmt.Sprintf("%d %d %d * *", startTime.Minute(), startTime.Hour(), startTime.Day())
	default:
		return ""
	}
export type Frequency = "minute" | "hour" | "day" | "week" | "month";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant