Sort function out of work

Sort function out of work

I create a collection and try to sort by date.
but no matter I use sort or sort key . the collection order didn't change. 

aaa.insert("1231231","2022-10-10");
aaa.insert("1231232","2022-10-11");
aaa.insert("1231233","2022-10-12");
aaa.sort(true);

aaa.insert("2022-10-10","1231231");
aaa.insert("2022-10-11""1231232");
aaa.insert("2022-10-12""1231233");
aaa.sortkey(true);