Skip to content

Instantly share code, notes, and snippets.

@randi274
Last active November 23, 2020 16:56
Show Gist options
  • Save randi274/e3c65e0734d0fc694c2de60a1ea561f8 to your computer and use it in GitHub Desktop.
Save randi274/e3c65e0734d0fc694c2de60a1ea561f8 to your computer and use it in GitHub Desktop.
Controller class that calls the Singleton class
public with sharing class SingeltonController {
@AuraEnabled
public static void printDateTime() {
DateTimeProvider dateProvider = DateTimeProvider.getInstance();
System.debug('Hey, is it a leap year?');
Boolean isLeapYear = Date.isLeapYear(dateProvider.now().year());
if (isLeapYear) {
System.debug('Yep! Get testing!');
} else {
System.debug('All clear. Enjoy your free time :) ');
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment