Skip to content

Commit

Permalink
IVYPORTAL-17944 Fix bug Portal.DateTimeFormat.DateFilterWithTime impo…
Browse files Browse the repository at this point in the history
…rt not working (#1190)

* feature/IVYPORTAL-17944-Fix-bug-Portal.DateTimeFormat.DateFilterWithTime-import-not-working - Fix import with time error

* feature/IVYPORTAL-17944-Fix-bug-Portal.DateTimeFormat.DateFilterWithTime-import-not-working - Update doc
  • Loading branch information
ntloc-axonivy authored Nov 6, 2024
1 parent 480c1a3 commit 138e3f8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,15 @@ public class DashboardFilter implements Serializable {
@JsonIgnore
public static final String DATE_FORMAT = "MM/dd/yyyy HH:mm";

@JsonIgnore
public static final String DATE_FORMAT_WITHOUT_TIME = "MM/dd/yyyy";

@JsonIgnore
public static final String DMY_DATE_FORMAT = "dd.MM.yyyy HH:mm";


@JsonIgnore
public static final String DMY_DATE_FORMAT_WITHOUT_TIME = "dd.MM.yyyy";

@JsonIgnore
private static final String DEFAULT = "default";

Expand Down Expand Up @@ -230,7 +236,7 @@ public void setTemp(boolean isTemp) {
public Date getFromDate() {
if (fromDate == null && StringUtils.isNotBlank(from)) {
try {
fromDate = DateUtils.parseDate(from, DATE_FORMAT, DMY_DATE_FORMAT);
fromDate = DateUtils.parseDate(from, DATE_FORMAT, DMY_DATE_FORMAT, DATE_FORMAT_WITHOUT_TIME, DMY_DATE_FORMAT_WITHOUT_TIME);
} catch (ParseException e) {
throw new PortalException("Cannot parse date " + from, e);
}
Expand All @@ -247,7 +253,7 @@ public void setFromDate(Date fromDate) {
public Date getToDate() {
if (toDate == null && StringUtils.isNotBlank(to)) {
try {
toDate = DateUtils.parseDate(to, DATE_FORMAT, DMY_DATE_FORMAT);
toDate = DateUtils.parseDate(to, DATE_FORMAT, DMY_DATE_FORMAT, DATE_FORMAT_WITHOUT_TIME, DMY_DATE_FORMAT_WITHOUT_TIME);
} catch (ParseException e) {
throw new PortalException("Cannot parse date " + to, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ Standard Column:
..
This column accepts all operators available for Date column. Fields may vary depending on the operator. The JSON example above covers most use cases for the Date field.
Acceptable date formats: ``dd.MM.yyyy`` and ``MM/dd/yyyy``.
Acceptable date formats: ``dd.MM.yyyy``, ``dd.MM.yyyy HH:mm``, ``MM/dd/yyyy`` and ``MM/dd/yyyy HH:mm``.

- ``category``

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ Standard Column:
These columns accept all operators available for Date column. Fields may
vary depending on the operator. The JSON example above covers most use
cases for the Date field. Acceptable date formats: ``dd.MM.yyyy`` and
``MM/dd/yyyy``.
cases for the Date field. Acceptable date formats: ``dd.MM.yyyy``, ``dd.MM.yyyy HH:mm``, ``MM/dd/yyyy`` and
``MM/dd/yyyy HH:mm``.

- ``application``

Expand Down

0 comments on commit 138e3f8

Please sign in to comment.