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,
|
submitError,
|
||||||
...rest
|
...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 {
|
const {
|
||||||
request: loadZoneInfo,
|
request: loadZoneInfo,
|
||||||
error: contentError,
|
error: contentError,
|
||||||
@ -154,12 +161,6 @@ function ScheduleForm({
|
|||||||
return (
|
return (
|
||||||
<Config>
|
<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 (
|
return (
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={{
|
initialValues={{
|
||||||
|
Loading…
Reference in New Issue
Block a user