Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@TheVishnuKumar
Last active December 9, 2018 05:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheVishnuKumar/46d6ffe918c245a00623c91a01c37597 to your computer and use it in GitHub Desktop.
Save TheVishnuKumar/46d6ffe918c245a00623c91a01c37597 to your computer and use it in GitHub Desktop.
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