VadimDez / ngx-order-pipe

▼ Angular 5+ orderBy pipe
https://vadimdez.github.io/ngx-order-pipe/
MIT License
243 stars 57 forks source link

Issue with sorter #41

Closed DotFivePin closed 3 years ago

DotFivePin commented 6 years ago

I have a date coming back in Long form. Like "1489069644" which is equal to "Thursday, March 9, 2017 2:27:24 PM" if converted.

When I sort on this, it gets stuck and is constantly trying to sort and resort in random orders. <div *ngFor="let note of detailsList?.notes | orderBy: 'note.timestamp'">

I am using this sort in other places, but never had an issue like this before. Do you know why its behaving this way?

These images were captured seconds apart. Its just constantly changing. (I am converting them when displaying) '{{note?.timestamp * 1000 | date:'MM/dd/yyyy hh:mm a'}}'

image

image

VadimDez commented 6 years ago

Could you provide array that you're trying to sort?

DotFivePin commented 6 years ago

This is how its coming back to me. Is this what you meant? { "notes":[
{
"timestamp":1489002240, "message":"message here", "user":"57ea" }, {
"timestamp":1489068169, "message":"message here", "user":"57ea" }, {
"timestamp":1489068388, "message":"message here", "user":"57ea" }, {
"timestamp":1489069644, "message":"message here", "user":"57ea" }, {
"timestamp":1489084233, "message":"message here", "user":"57ea" }, {
"timestamp":1489155705, "message":"message here", "user":"57ea" }, {
"timestamp":1489155718, "message":"message here", "user":"57ea" }, {
"timestamp":1489164617, "message":"message here", "user":"57ea" }, {
"timestamp":1489411959, "message":"message here", "user":"57ea" }, {
"timestamp":1489412001, "message":"message here", "user":"57ea" }, {
"timestamp":1489415015, "message":"message here", "user":"57ea" } ] }

DotFivePin commented 6 years ago

It almost seems as if it doesn't sort properly for me if there are a lot of entries in the array. If that makes sense.

I have an identical array that only has 4 things in it, and that one sorts fine.

DotFivePin commented 6 years ago

Update?

VadimDez commented 6 years ago

i've tried to reproduce your issue. but i couldn't get the same behaviour you get. Could you check whether you're doing some modifications on those items, so that it forces to re-order everything again?

VadimDez commented 6 years ago

@DotFivePin Could you try this issue with 2.0.0? Do you still have this problem?

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.