185
rated 0 times
[
186]
[
1]
/ answers: 1 / hits: 15611
/ 11 Years ago, fri, july 26, 2013, 12:00:00
I have an array. The array can contain 1 to 7 unique strings of day names. The day names will be in order from Mon to Sun. - eg:
[Tue, Thu, Sun]
I want to use javascript to sort that array so that the order will be beginning with today.
ie: if today is Friday, then the sorted array should be
[Sun, Tue, Thu]
if today is Thursday then the sorted array should be
[Thu, Sun, Tue]
Can anyone help?
More From » algorithm