mirror of
https://github.com/ansible/awx.git
synced 2024-10-30 13:55:31 +03:00
Moves generation of today and tomorrow strings out of the return of the ScheduleForm
This commit is contained in:
parent
0c26734d7d
commit
24c738c6d8
@ -121,6 +121,13 @@ function ScheduleForm({
|
||||
submitError,
|
||||
...rest
|
||||
}) {
|
||||
const now = new Date();
|
||||
const closestQuarterHour = new Date(
|
||||
Math.ceil(now.getTime() / 900000) * 900000
|
||||
);
|
||||
const tomorrow = new Date(closestQuarterHour);
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
|
||||
const {
|
||||
request: loadZoneInfo,
|
||||
error: contentError,
|
||||
@ -154,12 +161,6 @@ function ScheduleForm({
|
||||
return (
|
||||
<Config>
|
||||
{() => {
|
||||
const now = new Date();
|
||||
const closestQuarterHour = new Date(
|
||||
Math.ceil(now.getTime() / 900000) * 900000
|
||||
);
|
||||
const tomorrow = new Date(closestQuarterHour);
|
||||
tomorrow.setDate(tomorrow.getDate() + 1);
|
||||
return (
|
||||
<Formik
|
||||
initialValues={{
|
||||
|
Loading…
Reference in New Issue
Block a user