Skip to content

Instantly share code, notes, and snippets.

@randi274
Last active November 23, 2020 16:56
Embed
What would you like to do?
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