Conversation
|
demo |
| } | ||
|
|
||
|
|
||
| countObliqueIsTwo(str: string): boolean { |
There was a problem hiding this comment.
Create common method for countObliqueIsTwo and countHyphenIsTwo which will be invoked from these 2 methods..
There was a problem hiding this comment.
done in refactor commit
| countObliqueIsTwo(str: string): boolean { | ||
| let oblique = '/'; | ||
| let count = 0; | ||
| for (let i = 0; i < str.length; i++) { |
There was a problem hiding this comment.
Remove 'for' loop and convert to regEx matching..
(str.match(/\//g) || []).length
There was a problem hiding this comment.
done in refactor commit
| return false; | ||
| } | ||
|
|
||
| convertDateObjectToString(dateObject: Date): string { |
There was a problem hiding this comment.
This method should accept optional parameter for separator.. default value for separator will be "/" otherwise whatever is passed in parameter
| return isoDateRegex.test(str); | ||
| } | ||
|
|
||
| formatDate(str: any): string { |
There was a problem hiding this comment.
duplicate method... convertDateObjectToString can be invoked in this method.. remove duplicate code..
| } | ||
|
|
||
|
|
||
| lessThanCheck(lhs: any, rhs: any): boolean { |
There was a problem hiding this comment.
change method name... dateComparisonLessThan
| return lhsDate.getTime() < rhsDate.getTime(); | ||
| } | ||
|
|
||
| greaterThanCheck(lhs: any, rhs: any): boolean { |
There was a problem hiding this comment.
change method name... dateComparisonGreaterThan
|
|
||
| } | ||
|
|
||
| greaterThanDate(lhs: any, rhs: any): boolean { |
There was a problem hiding this comment.
Remove redundant code in lessThanDate and greaterThanDate.. convert common code to method and invoke that method
added functions to check equality of dates from lhs towards rhs in executer file -> tasks