Ad
  • Custom User Avatar

    This is a total overkill - converting date to string and parsing it, while there are methods that already return proper numeric values for each date part.
    In addition, using if's THEN clause to only return true, and ELSE clause to only return false is completely redundant. Since if's expression must evaluate to bool-y value, you may just return it right away.
    Also, there are two bad smells:

    • an incosistency in braces usage - you use them to contain THEN clause, but not ELSE clause
    • unnecessary //TODO comment