Fixed date sorting bug in the tree view