92
92
</b-table-column >
93
93
<b-table-column
94
94
:visible =" columnsVisible['Date'].display"
95
- field =" Date "
95
+ field =" Timestamp "
96
96
label =" Date"
97
97
sortable
98
98
v-slot =" props" >
@@ -178,7 +178,10 @@ type TableRow = {
178
178
Sale: string
179
179
SaleFormatted? : string
180
180
Date: string
181
+ Time: string
182
+ SortKey: number
181
183
Block: string
184
+ Amount: number
182
185
Items? : TableRow []
183
186
Item: NFTItem
184
187
}
@@ -257,12 +260,14 @@ export default class Holder extends mixins(ChainMixin, KeyboardEventsMixin) {
257
260
258
261
for (const newEvent of this .events ) {
259
262
const date = new Date (newEvent [' timestamp' ])
263
+ const timestamp = date .getTime ()
260
264
const dateStr = parseDate (date )
261
265
const formatTime = formatDistanceToNow (date , { addSuffix: true })
262
266
const block = String (newEvent [' blockNumber' ])
263
267
const commonInfo = {
264
268
Date: dateStr ,
265
269
Time: formatTime ,
270
+ Timestamp: timestamp ,
266
271
Block: block ,
267
272
Amount: 1 ,
268
273
}
@@ -272,6 +277,7 @@ export default class Holder extends mixins(ChainMixin, KeyboardEventsMixin) {
272
277
itemRowMap [nftId ] = {
273
278
Item: newEvent [' nft' ],
274
279
Holder: newEvent [' caller' ],
280
+ SortKey: timestamp ,
275
281
Bought: 0 ,
276
282
Sale: 0 ,
277
283
... commonInfo ,
@@ -295,11 +301,13 @@ export default class Holder extends mixins(ChainMixin, KeyboardEventsMixin) {
295
301
if (itemRowMap [nftId ]) {
296
302
if (! (' Bought' in itemRowMap [nftId ])) {
297
303
itemRowMap [nftId ][' Bought' ] = 0
304
+ itemRowMap [nftId ][' SortKey' ] = timestamp
298
305
}
299
306
} else {
300
307
itemRowMap [nftId ] = {
301
308
Item: newEvent [' nft' ],
302
309
Holder: newEvent [' meta' ],
310
+ SortKey: timestamp ,
303
311
Bought: 0 ,
304
312
Sale: 0 ,
305
313
... commonInfo ,
@@ -320,11 +328,13 @@ export default class Holder extends mixins(ChainMixin, KeyboardEventsMixin) {
320
328
if (itemRowMap [nftId ]) {
321
329
if (! (' Bought' in itemRowMap [nftId ])) {
322
330
itemRowMap [nftId ][' Bought' ] = bought
331
+ itemRowMap [nftId ][' SortKey' ] = timestamp
323
332
}
324
333
} else {
325
334
itemRowMap [nftId ] = {
326
335
Item: newEvent [' nft' ],
327
336
Holder: newEvent [' caller' ],
337
+ SortKey: timestamp ,
328
338
Bought: bought ,
329
339
Sale: 0 ,
330
340
... commonInfo ,
@@ -363,6 +373,7 @@ export default class Holder extends mixins(ChainMixin, KeyboardEventsMixin) {
363
373
group [' Items' ].forEach ((item ) => {
364
374
parsePriceForItem (item , this .decimals , this .unit )
365
375
})
376
+ group [' Items' ] = group [' Items' ].sort ((a , b ) => b .SortKey - a .SortKey )
366
377
})
367
378
return holderGroupsList
368
379
}
0 commit comments