diff --git a/src/client/app/components/admin/PreferencesComponent.tsx b/src/client/app/components/admin/PreferencesComponent.tsx
index b1d453c27..34f891e41 100644
--- a/src/client/app/components/admin/PreferencesComponent.tsx
+++ b/src/client/app/components/admin/PreferencesComponent.tsx
@@ -46,7 +46,7 @@ export default function PreferencesComponent() {
setLocalAdminPref(cloneDeep(adminPreferences));
};
- // small functions that determine if fields are invalid to warn the user
+ // small functions that determine if fields are invalid
const invalidReadingFreq = () => {
const frequency = moment.duration(localAdminPref.defaultMeterReadingFrequency);
return !frequency.isValid() || frequency.asSeconds() <= 0;
@@ -197,6 +197,9 @@ export default function PreferencesComponent() {
onChange={e => makeLocalChanges('defaultMeterReadingFrequency', e.target.value)}
invalid={invalidReadingFreq()}
/>
+
@@ -206,6 +209,8 @@ export default function PreferencesComponent() {
type='number'
value={localAdminPref.defaultMeterMinimumValue}
onChange={e => makeLocalChanges('defaultMeterMinimumValue', e.target.value)}
+ min={MIN_VAL}
+ max={Number(localAdminPref.defaultMeterMaximumValue)}
maxLength={50}
invalid={invalidMinValue()}
/>
@@ -221,6 +226,8 @@ export default function PreferencesComponent() {
type='number'
value={localAdminPref.defaultMeterMaximumValue}
onChange={e => makeLocalChanges('defaultMeterMaximumValue', e.target.value)}
+ min={Number(localAdminPref.defaultMeterMinimumValue)}
+ max={MAX_VAL}
maxLength={50}
invalid={invalidMaxValue()}
/>
@@ -255,7 +262,7 @@ export default function PreferencesComponent() {
invalid={invalidMaxDate()}
/>