From 23c839f157218bcbbeef536edb19d5e46bebe369 Mon Sep 17 00:00:00 2001 From: Maia Iyer Date: Mon, 9 Aug 2021 15:13:41 -0400 Subject: [PATCH] allow for pm times to be entered --- tornjak-frontend/src/components/entry-create.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tornjak-frontend/src/components/entry-create.js b/tornjak-frontend/src/components/entry-create.js index 32362fd4..7dcfa09c 100644 --- a/tornjak-frontend/src/components/entry-create.js +++ b/tornjak-frontend/src/components/entry-create.js @@ -216,7 +216,7 @@ class CreateEntry extends Component { }); } - onChangeExpiryOption(e) { //TODO try date=date + onChangeExpiryOption(e) { this.setState({ expiresAt: 0, expiryOption: e.selectedItem @@ -224,7 +224,8 @@ class CreateEntry extends Component { } isValidJSTime(seconds) { - return seconds > 0 && seconds <= 8640000000000 //TODO clean + const JSMaxSafeTime = 8640000000000 + return seconds > 0 && seconds <= JSMaxSafeTime } expiryTimeUpdate(seconds) { @@ -245,7 +246,8 @@ class CreateEntry extends Component { this.expiryTimeUpdate(seconds) } - isValidDate(d) { + // TODO some odd behavior with dates like February 33 exists + isValidDate(d) { // date is successfully translated return d instanceof Date && isFinite(d) } @@ -702,7 +704,6 @@ class CreateEntry extends Component { placeholder="mm/dd/yyyy" labelText="Enter a date" onChange={this.onChangeExpiresAtDate} - required /> @@ -710,8 +711,8 @@ class CreateEntry extends Component {