Last active
December 9, 2018 05:36
-
-
Save TheVishnuKumar/46d6ffe918c245a00623c91a01c37597 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BirthDayWishesController { | |
//This method check for birthday with today's date. If condition get matched then it retues the true. | |
@AuraEnabled | |
public static boolean wishTheBirthDay(){ | |
User currentLoggedinUser = [Select id,Date_of_Birth__c from User Where Id =: UserInfo.getUserId() ]; | |
if( currentLoggedinUser.Date_of_Birth__c != null ){ | |
if( Date.today().Day() == currentLoggedinUser.Date_of_Birth__c.Day() && | |
Date.today().Month() == currentLoggedinUser.Date_of_Birth__c.Month()){ | |
return true; | |
} | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment