knockout.js - Knockoutjs - .sort() sorting in reverse order in Safari -


in knockout view model have following:

this.files.sort(function(f1, f2) {     if (mostrecentfirst) {         return f1.creationdate < f2.creationdate ? -1 : 1;     } else {         return f1.creationdate > f2.creationdate ? -1 : 1;     } }); 

in firefox, chrome , ie sorts expected.

but in safari sorts in reverse order.

any suggestions why happening?

update: creationdate property contains json date string, eg "2013-04-26t12:08:02".

update 2: i've got around problem using push or unshift add elements array, isn't great solution because assumes data presented has been ordered. it's no longer immediate problem i'd still know why safari sorting in reverse order.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -