Revision 59187
Added by Konstantinos Triantafyllou almost 4 years ago
string-utils.class.ts | ||
---|---|---|
271 | 271 |
} |
272 | 272 |
return false; |
273 | 273 |
} |
274 |
|
|
275 |
public static getDateFromString(dateString: string): Date { |
|
276 |
let date = new Date(dateString); |
|
277 |
if (Object.prototype.toString.call(date) === "[object Date]") { |
|
278 |
if (isNaN(date.getTime())) { |
|
279 |
return null; |
|
280 |
} else { |
|
281 |
return date; |
|
282 |
} |
|
283 |
} else { |
|
284 |
return null; |
|
285 |
} |
|
286 |
} |
|
274 | 287 |
} |
Also available in: Unified diff
[Library | Trunk]: Fix invalid date exception