Skip to content

Commit

Permalink
Ignore time components for Date/NullableDate
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleeckx committed Jul 20, 2016
1 parent 1df1f47 commit ddc5db8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Libs/Typings/Vidyano.Common/vidyano.common.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ interface Date {

netOffset(value: string);
netOffset(): string;

format(format: string): string;
}

interface Number {
Expand Down
10 changes: 10 additions & 0 deletions src/Libs/Vidyano/vidyano.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,16 @@ namespace Vidyano {

case "Date":
case "NullableDate":
if (!StringEx.isNullOrEmpty(value)) {
let date: Date = value;
if (typeof (date) === "string")
date = new Date(value);

return `${date.format("dd-MM-yyyy")} 00:00:00`;
}

break;

case "DateTime":
case "NullableDateTime":
if (!StringEx.isNullOrEmpty(value)) {
Expand Down

0 comments on commit ddc5db8

Please sign in to comment.