Sort string array by analysing date details in those strings
- by Jason Evans
I have a requirement for the project I'm working on right now which is proving a bit tricky for me.
Basically I have to sort an array of items based on the Text property of those items:
Here are my items:
var answers = [],
answer1 = { Id: 1, Text: '3-4 weeks ago' },
answer2 = { Id: 2, Text: '1-2 weeks ago' },
answer3 = { Id: 3, Text:…