[KEYCLOAK-1200] From and To filter fields in Event viewer in admin app

This commit is contained in:
girirajsharma 2015-05-29 19:13:56 +05:30
parent 058f44743c
commit 5bb71d396a
3 changed files with 9 additions and 9 deletions

View file

@ -48,13 +48,13 @@
<div class="form-group">
<label class="col-sm-2 control-label" for="dateFrom">Date (From)</label>
<div class="col-sm-4">
<input class="form-control" type="date" id="dateFrom" name="dateFrom" data-ng-model="query.dateFrom">
<input class="form-control" type="text" id="dateFrom" name="dateFrom" data-ng-model="query.dateFrom" placeholder="yyyy-MM-dd">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" for="dateTo">Date (To)</label>
<div class="col-sm-4">
<input class="form-control" type="date" id="dateTo" name="dateTo" data-ng-model="query.dateTo">
<input class="form-control" type="text" id="dateTo" name="dateTo" data-ng-model="query.dateTo" placeholder="yyyy-MM-dd">
</div>
</div>

View file

@ -52,13 +52,13 @@
<div class="form-group" data-ng-show="filter">
<label class="col-md-2 control-label" for="dateFrom">Date (From)</label>
<div class="col-md-6">
<input class="form-control" type="date" id="dateFrom" name="dateFrom" data-ng-model="query.dateFrom">
<input class="form-control" type="text" id="dateFrom" name="dateFrom" data-ng-model="query.dateFrom" placeholder="yyyy-MM-dd">
</div>
</div>
<div class="form-group" data-ng-show="filter">
<label class="col-md-2 control-label" for="dateTo">Date (To)</label>
<div class="col-md-6">
<input class="form-control" type="date" id="dateTo" name="dateTo" data-ng-model="query.dateTo">
<input class="form-control" type="text" id="dateTo" name="dateTo" data-ng-model="query.dateTo" placeholder="yyyy-MM-dd">
</div>
</div>

View file

@ -392,7 +392,7 @@ public class RealmAdminResource {
try {
from = df.parse(dateFrom);
} catch (ParseException e) {
throw new BadRequestException("Invalid value for 'Date(From)', excepted format is yyyy-MM-dd");
throw new BadRequestException("Invalid value for 'Date(From)', expected format is yyyy-MM-dd");
}
query.fromDate(from);
}
@ -403,7 +403,7 @@ public class RealmAdminResource {
try {
to = df.parse(dateTo);
} catch (ParseException e) {
throw new BadRequestException("Invalid value for 'Date(To)', excepted format is yyyy-MM-dd");
throw new BadRequestException("Invalid value for 'Date(To)', expected format is yyyy-MM-dd");
}
query.toDate(to);
}
@ -485,18 +485,18 @@ public class RealmAdminResource {
try {
from = df.parse(dateFrom);
} catch (ParseException e) {
throw new BadRequestException("Invalid value for 'Date(From)', excepted format is yyyy-MM-dd");
throw new BadRequestException("Invalid value for 'Date(From)', expected format is yyyy-MM-dd");
}
query.fromTime(from);
}
if(dateTo != null) {
SimpleDateFormat df = new SimpleDateFormat("Invalid value for 'Date(To)', excepted format is yyyy-MM-dd");
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
Date to = null;
try {
to = df.parse(dateTo);
} catch (ParseException e) {
throw new BadRequestException("An unexpected server error has occurred");
throw new BadRequestException("Invalid value for 'Date(To)', expected format is yyyy-MM-dd");
}
query.toTime(to);
}