I hold a dataset with employment history. There are two fields for the employment dateTo:
yearTo, monthTo
To accurately sort the employment history by the most recent dateTo, I utilize the following code:
<tr id="employment_history_" ng-repeat="history in candidate.employmentHistory | orderBy : ['-yearTo','monthTo',] | date:['YYYY', 'MMM'] ">
The sorting functions as intended. However, there is one dilemma. The field monthTo
may include the value Present
instead of solely the month date format like JAN, FEB MAR
, etc.
My question is how can I prioritize records with the monthTo
value of Present
to appear first on the list despite having a date
format?