Skip to main content
2 of 6
added 45 characters in body
SFDC shaikh
  • 747
  • 3
  • 15
  • 35

Sort List of SObject in Wrapper Calss

I have Wrapper class which contains List of Map. After performing some operations that List values order gets changed.

public Class TeacherWrapper{
     public Map<Date,List<Session__c>> dateSession{set;get;}
     public TeacherAvailabilityWrapper(){
           dateSession= new Map<Date,List<Session__c>>();
     }
}

Now I want to sort List<Session__c> of dateSession. Based on Start_time__c (DateTime)field in session.

How to achieve it using Comparable interface?

SFDC shaikh
  • 747
  • 3
  • 15
  • 35