this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use more Date.parse and Date.now

+134 -142
+1 -1
src/components/account-info.jsx
··· 123 123 // Count days since last post 124 124 if (statuses.length) { 125 125 stats.daysSinceLastPost = Math.ceil( 126 - (Date.now() - new Date(statuses[statuses.length - 1].createdAt)) / 126 + (Date.now() - Date.parse(statuses[statuses.length - 1].createdAt)) / 127 127 86400000, 128 128 ); 129 129 }
+1 -2
src/components/compose-button.jsx
··· 196 196 {latestPosts.length > 0 && 197 197 latestPosts.map((post) => { 198 198 const createdDate = new Date(post.createdAt); 199 - const isWithinDay = 200 - new Date().getTime() - createdDate.getTime() < 86400000; 199 + const isWithinDay = Date.now() - createdDate.getTime() < 86400000; 201 200 202 201 return ( 203 202 <MenuItem key={post.id} onClick={() => handleReplyToPost(post)}>
+2 -2
src/components/compose.jsx
··· 100 100 101 101 const expiresInFromExpiresAt = (expiresAt) => { 102 102 if (!expiresAt) return oneDay; 103 - const delta = (new Date(expiresAt).getTime() - Date.now()) / 1000; 103 + const delta = (Date.parse(expiresAt) - Date.now()) / 1000; 104 104 return expirySeconds.find((s) => s >= delta) || oneDay; 105 105 }; 106 106 ··· 747 747 () => 748 748 !!replyToStatus?.createdAt && 749 749 Math.floor( 750 - (Date.now() - new Date(replyToStatus.createdAt)) / 750 + (Date.now() - Date.parse(replyToStatus.createdAt)) / 751 751 (1000 * 60 * 60 * 24 * 30), 752 752 ), 753 753 [replyToStatus],
+1 -3
src/components/drafts.jsx
··· 31 31 if (ownKeys.length) { 32 32 const drafts = await db.drafts.getMany(ownKeys); 33 33 drafts.sort( 34 - (a, b) => 35 - new Date(b.updatedAt).getTime() - 36 - new Date(a.updatedAt).getTime(), 34 + (a, b) => Date.parse(b.updatedAt) - Date.parse(a.updatedAt), 37 35 ); 38 36 setDrafts(drafts); 39 37 } else {
+1 -2
src/components/status.jsx
··· 2571 2571 <a href={url} target="_blank" rel="noopener"> 2572 2572 { 2573 2573 // within a day 2574 - new Date().getTime() - createdAtDate.getTime() < 2575 - 86400000 && ( 2574 + Date.now() - createdAtDate.getTime() < 86400000 && ( 2576 2575 <> 2577 2576 <RelativeTime 2578 2577 datetime={createdAtDate}
+108 -108
src/locales/en.po
··· 111 111 #: src/components/status.jsx:1997 112 112 #: src/components/status.jsx:2014 113 113 #: src/components/status.jsx:2145 114 - #: src/components/status.jsx:2770 115 - #: src/components/status.jsx:2773 114 + #: src/components/status.jsx:2769 115 + #: src/components/status.jsx:2772 116 116 #: src/pages/account-statuses.jsx:539 117 117 #: src/pages/accounts.jsx:118 118 118 #: src/pages/hashtag.jsx:203 ··· 355 355 #: src/components/account-info.jsx:1531 356 356 #: src/components/shortcuts-settings.jsx:1059 357 357 #: src/components/status.jsx:1428 358 - #: src/components/status.jsx:3548 358 + #: src/components/status.jsx:3547 359 359 msgid "Copy" 360 360 msgstr "" 361 361 ··· 468 468 #: src/components/compose.jsx:3248 469 469 #: src/components/compose.jsx:3457 470 470 #: src/components/compose.jsx:3687 471 - #: src/components/drafts.jsx:59 471 + #: src/components/drafts.jsx:57 472 472 #: src/components/embed-modal.jsx:13 473 473 #: src/components/generic-accounts.jsx:151 474 474 #: src/components/keyboard-shortcuts-help.jsx:43 ··· 480 480 #: src/components/shortcuts-settings.jsx:230 481 481 #: src/components/shortcuts-settings.jsx:583 482 482 #: src/components/shortcuts-settings.jsx:783 483 - #: src/components/status.jsx:3272 484 - #: src/components/status.jsx:3512 485 - #: src/components/status.jsx:4021 483 + #: src/components/status.jsx:3271 484 + #: src/components/status.jsx:3511 485 + #: src/components/status.jsx:4020 486 486 #: src/pages/accounts.jsx:45 487 487 #: src/pages/catchup.jsx:1584 488 488 #: src/pages/filters.jsx:225 489 489 #: src/pages/list.jsx:302 490 - #: src/pages/notifications.jsx:942 491 - #: src/pages/scheduled-posts.jsx:259 490 + #: src/pages/notifications.jsx:943 491 + #: src/pages/scheduled-posts.jsx:258 492 492 #: src/pages/settings.jsx:90 493 493 #: src/pages/status.jsx:1488 494 494 msgid "Close" ··· 576 576 #: src/components/list-add-edit.jsx:152 577 577 #: src/components/shortcuts-settings.jsx:715 578 578 #: src/pages/filters.jsx:570 579 - #: src/pages/notifications.jsx:1008 579 + #: src/pages/notifications.jsx:1009 580 580 msgid "Save" 581 581 msgstr "" 582 582 ··· 613 613 #: src/pages/filters.jsx:90 614 614 #: src/pages/followed-hashtags.jsx:41 615 615 #: src/pages/home.jsx:54 616 - #: src/pages/notifications.jsx:587 616 + #: src/pages/notifications.jsx:588 617 617 #: src/pages/scheduled-posts.jsx:74 618 618 msgid "Home" 619 619 msgstr "" ··· 808 808 #: src/components/status.jsx:1191 809 809 #: src/components/status.jsx:1977 810 810 #: src/components/status.jsx:1978 811 - #: src/components/status.jsx:2674 811 + #: src/components/status.jsx:2673 812 812 msgid "Reply" 813 813 msgstr "" 814 814 ··· 1011 1011 msgid "Error loading GIFs" 1012 1012 msgstr "" 1013 1013 1014 - #: src/components/drafts.jsx:64 1014 + #: src/components/drafts.jsx:62 1015 1015 #: src/pages/settings.jsx:702 1016 1016 msgid "Unsent drafts" 1017 1017 msgstr "" 1018 1018 1019 - #: src/components/drafts.jsx:69 1019 + #: src/components/drafts.jsx:67 1020 1020 msgid "Looks like you have unsent drafts. Let's continue where you left off." 1021 1021 msgstr "" 1022 1022 1023 - #: src/components/drafts.jsx:103 1023 + #: src/components/drafts.jsx:101 1024 1024 msgid "Delete this draft?" 1025 1025 msgstr "" 1026 1026 1027 - #: src/components/drafts.jsx:118 1027 + #: src/components/drafts.jsx:116 1028 1028 msgid "Error deleting draft! Please try again." 1029 1029 msgstr "" 1030 1030 1031 - #: src/components/drafts.jsx:128 1031 + #: src/components/drafts.jsx:126 1032 1032 #: src/components/list-add-edit.jsx:188 1033 1033 #: src/components/status.jsx:1594 1034 1034 #: src/pages/filters.jsx:603 1035 - #: src/pages/scheduled-posts.jsx:369 1035 + #: src/pages/scheduled-posts.jsx:368 1036 1036 msgid "Delete…" 1037 1037 msgstr "" 1038 1038 1039 - #: src/components/drafts.jsx:147 1039 + #: src/components/drafts.jsx:145 1040 1040 msgid "Error fetching reply-to status!" 1041 1041 msgstr "" 1042 1042 1043 - #: src/components/drafts.jsx:172 1043 + #: src/components/drafts.jsx:170 1044 1044 msgid "Delete all drafts?" 1045 1045 msgstr "" 1046 1046 1047 - #: src/components/drafts.jsx:190 1047 + #: src/components/drafts.jsx:188 1048 1048 msgid "Error deleting drafts! Please try again." 1049 1049 msgstr "" 1050 1050 1051 - #: src/components/drafts.jsx:202 1051 + #: src/components/drafts.jsx:200 1052 1052 msgid "Delete all…" 1053 1053 msgstr "" 1054 1054 1055 - #: src/components/drafts.jsx:210 1055 + #: src/components/drafts.jsx:208 1056 1056 msgid "No drafts found." 1057 1057 msgstr "" 1058 1058 1059 - #: src/components/drafts.jsx:247 1059 + #: src/components/drafts.jsx:245 1060 1060 #: src/pages/catchup.jsx:1932 1061 1061 msgid "Poll" 1062 1062 msgstr "" 1063 1063 1064 - #: src/components/drafts.jsx:250 1064 + #: src/components/drafts.jsx:248 1065 1065 #: src/pages/account-statuses.jsx:375 1066 1066 msgid "Media" 1067 1067 msgstr "" ··· 1071 1071 msgstr "" 1072 1072 1073 1073 #: src/components/follow-request-buttons.jsx:43 1074 - #: src/pages/notifications.jsx:992 1074 + #: src/pages/notifications.jsx:993 1075 1075 msgid "Accept" 1076 1076 msgstr "" 1077 1077 ··· 1080 1080 msgstr "" 1081 1081 1082 1082 #: src/components/follow-request-buttons.jsx:76 1083 - #: src/pages/notifications.jsx:1276 1083 + #: src/pages/notifications.jsx:1277 1084 1084 msgid "Accepted" 1085 1085 msgstr "" 1086 1086 ··· 1099 1099 #: src/components/generic-accounts.jsx:214 1100 1100 #: src/components/timeline.jsx:552 1101 1101 #: src/pages/list.jsx:321 1102 - #: src/pages/notifications.jsx:922 1102 + #: src/pages/notifications.jsx:923 1103 1103 #: src/pages/search.jsx:562 1104 1104 #: src/pages/status.jsx:1521 1105 1105 msgid "Show more…" ··· 1240 1240 1241 1241 #: src/components/keyboard-shortcuts-help.jsx:176 1242 1242 #: src/components/status.jsx:1199 1243 - #: src/components/status.jsx:2701 1243 + #: src/components/status.jsx:2700 1244 + #: src/components/status.jsx:2723 1244 1245 #: src/components/status.jsx:2724 1245 - #: src/components/status.jsx:2725 1246 1246 msgid "Boost" 1247 1247 msgstr "" 1248 1248 ··· 1252 1252 1253 1253 #: src/components/keyboard-shortcuts-help.jsx:184 1254 1254 #: src/components/status.jsx:1262 1255 + #: src/components/status.jsx:2748 1255 1256 #: src/components/status.jsx:2749 1256 - #: src/components/status.jsx:2750 1257 1257 msgid "Bookmark" 1258 1258 msgstr "" 1259 1259 ··· 1362 1362 msgstr "" 1363 1363 1364 1364 #: src/components/media-post.jsx:133 1365 - #: src/components/status.jsx:3851 1366 - #: src/components/status.jsx:3947 1367 - #: src/components/status.jsx:4025 1365 + #: src/components/status.jsx:3850 1366 + #: src/components/status.jsx:3946 1367 + #: src/components/status.jsx:4024 1368 1368 #: src/components/timeline.jsx:1004 1369 1369 #: src/pages/catchup.jsx:75 1370 1370 #: src/pages/catchup.jsx:1880 ··· 1411 1411 #: src/components/nav-menu.jsx:190 1412 1412 #: src/components/shortcuts-settings.jsx:140 1413 1413 #: src/pages/following.jsx:23 1414 - #: src/pages/following.jsx:145 1414 + #: src/pages/following.jsx:143 1415 1415 msgid "following.title" 1416 1416 msgstr "Following" 1417 1417 ··· 1438 1438 #: src/pages/home.jsx:86 1439 1439 #: src/pages/home.jsx:198 1440 1440 #: src/pages/notifications.jsx:117 1441 - #: src/pages/notifications.jsx:591 1441 + #: src/pages/notifications.jsx:592 1442 1442 msgid "Notifications" 1443 1443 msgstr "" 1444 1444 ··· 2286 2286 2287 2287 #: src/components/status.jsx:1199 2288 2288 #: src/components/status.jsx:1239 2289 - #: src/components/status.jsx:2701 2290 - #: src/components/status.jsx:2724 2289 + #: src/components/status.jsx:2700 2290 + #: src/components/status.jsx:2723 2291 2291 msgid "Unboost" 2292 2292 msgstr "" 2293 2293 2294 2294 #: src/components/status.jsx:1215 2295 - #: src/components/status.jsx:2716 2295 + #: src/components/status.jsx:2715 2296 2296 msgid "Quote" 2297 2297 msgstr "" 2298 2298 ··· 2314 2314 2315 2315 #: src/components/status.jsx:1252 2316 2316 #: src/components/status.jsx:1987 2317 - #: src/components/status.jsx:2737 2317 + #: src/components/status.jsx:2736 2318 2318 msgid "Unlike" 2319 2319 msgstr "" 2320 2320 2321 2321 #: src/components/status.jsx:1253 2322 2322 #: src/components/status.jsx:1987 2323 2323 #: src/components/status.jsx:1988 2324 + #: src/components/status.jsx:2736 2324 2325 #: src/components/status.jsx:2737 2325 - #: src/components/status.jsx:2738 2326 2326 msgid "Like" 2327 2327 msgstr "" 2328 2328 2329 2329 #: src/components/status.jsx:1262 2330 - #: src/components/status.jsx:2749 2330 + #: src/components/status.jsx:2748 2331 2331 msgid "Unbookmark" 2332 2332 msgstr "" 2333 2333 ··· 2357 2357 msgstr "" 2358 2358 2359 2359 #: src/components/status.jsx:1463 2360 - #: src/components/status.jsx:3517 2360 + #: src/components/status.jsx:3516 2361 2361 msgid "Embed post" 2362 2362 msgstr "" 2363 2363 ··· 2427 2427 2428 2428 #: src/components/status.jsx:1988 2429 2429 #: src/components/status.jsx:2024 2430 - #: src/components/status.jsx:2738 2430 + #: src/components/status.jsx:2737 2431 2431 msgid "Liked" 2432 2432 msgstr "" 2433 2433 2434 2434 #: src/components/status.jsx:2021 2435 - #: src/components/status.jsx:2725 2435 + #: src/components/status.jsx:2724 2436 2436 msgid "Boosted" 2437 2437 msgstr "" 2438 2438 2439 2439 #: src/components/status.jsx:2031 2440 - #: src/components/status.jsx:2750 2440 + #: src/components/status.jsx:2749 2441 2441 msgid "Bookmarked" 2442 2442 msgstr "" 2443 2443 ··· 2476 2476 msgid "Show media" 2477 2477 msgstr "" 2478 2478 2479 - #: src/components/status.jsx:2598 2479 + #: src/components/status.jsx:2597 2480 2480 msgid "Edited" 2481 2481 msgstr "" 2482 2482 2483 - #: src/components/status.jsx:2675 2483 + #: src/components/status.jsx:2674 2484 2484 msgid "Comments" 2485 2485 msgstr "" 2486 2486 2487 2487 #. More from [Author] 2488 - #: src/components/status.jsx:2975 2488 + #: src/components/status.jsx:2974 2489 2489 msgid "More from <0/>" 2490 2490 msgstr "More from <0/>" 2491 2491 2492 - #: src/components/status.jsx:3277 2492 + #: src/components/status.jsx:3276 2493 2493 msgid "Edit History" 2494 2494 msgstr "" 2495 2495 2496 - #: src/components/status.jsx:3281 2496 + #: src/components/status.jsx:3280 2497 2497 msgid "Failed to load history" 2498 2498 msgstr "" 2499 2499 2500 - #: src/components/status.jsx:3286 2500 + #: src/components/status.jsx:3285 2501 2501 #: src/pages/annual-report.jsx:45 2502 2502 msgid "Loading…" 2503 2503 msgstr "" 2504 2504 2505 - #: src/components/status.jsx:3522 2505 + #: src/components/status.jsx:3521 2506 2506 msgid "HTML Code" 2507 2507 msgstr "" 2508 2508 2509 - #: src/components/status.jsx:3539 2509 + #: src/components/status.jsx:3538 2510 2510 msgid "HTML code copied" 2511 2511 msgstr "" 2512 2512 2513 - #: src/components/status.jsx:3542 2513 + #: src/components/status.jsx:3541 2514 2514 msgid "Unable to copy HTML code" 2515 2515 msgstr "" 2516 2516 2517 - #: src/components/status.jsx:3554 2517 + #: src/components/status.jsx:3553 2518 2518 msgid "Media attachments:" 2519 2519 msgstr "" 2520 2520 2521 - #: src/components/status.jsx:3576 2521 + #: src/components/status.jsx:3575 2522 2522 msgid "Account Emojis:" 2523 2523 msgstr "" 2524 2524 2525 - #: src/components/status.jsx:3607 2526 - #: src/components/status.jsx:3652 2525 + #: src/components/status.jsx:3606 2526 + #: src/components/status.jsx:3651 2527 2527 msgid "static URL" 2528 2528 msgstr "" 2529 2529 2530 - #: src/components/status.jsx:3621 2530 + #: src/components/status.jsx:3620 2531 2531 msgid "Emojis:" 2532 2532 msgstr "" 2533 2533 2534 - #: src/components/status.jsx:3666 2534 + #: src/components/status.jsx:3665 2535 2535 msgid "Notes:" 2536 2536 msgstr "" 2537 2537 2538 - #: src/components/status.jsx:3670 2538 + #: src/components/status.jsx:3669 2539 2539 msgid "This is static, unstyled and scriptless. You may need to apply your own styles and edit as needed." 2540 2540 msgstr "" 2541 2541 2542 - #: src/components/status.jsx:3676 2542 + #: src/components/status.jsx:3675 2543 2543 msgid "Polls are not interactive, becomes a list with vote counts." 2544 2544 msgstr "" 2545 2545 2546 - #: src/components/status.jsx:3681 2546 + #: src/components/status.jsx:3680 2547 2547 msgid "Media attachments can be images, videos, audios or any file types." 2548 2548 msgstr "" 2549 2549 2550 - #: src/components/status.jsx:3687 2550 + #: src/components/status.jsx:3686 2551 2551 msgid "Post could be edited or deleted later." 2552 2552 msgstr "" 2553 2553 2554 - #: src/components/status.jsx:3693 2554 + #: src/components/status.jsx:3692 2555 2555 msgid "Preview" 2556 2556 msgstr "" 2557 2557 2558 - #: src/components/status.jsx:3702 2558 + #: src/components/status.jsx:3701 2559 2559 msgid "Note: This preview is lightly styled." 2560 2560 msgstr "" 2561 2561 2562 2562 #. [Name] [Visibility icon] boosted 2563 - #: src/components/status.jsx:3955 2563 + #: src/components/status.jsx:3954 2564 2564 msgid "<0/> <1/> boosted" 2565 2565 msgstr "<0/> <1/> boosted" 2566 2566 2567 - #: src/components/status.jsx:4057 2567 + #: src/components/status.jsx:4056 2568 2568 msgid "Post hidden by your filters" 2569 2569 msgstr "Post hidden by your filters" 2570 2570 2571 - #: src/components/status.jsx:4058 2571 + #: src/components/status.jsx:4057 2572 2572 msgid "Post pending" 2573 2573 msgstr "Post pending" 2574 2574 2575 + #: src/components/status.jsx:4058 2575 2576 #: src/components/status.jsx:4059 2576 2577 #: src/components/status.jsx:4060 2577 2578 #: src/components/status.jsx:4061 2578 - #: src/components/status.jsx:4062 2579 2579 msgid "Post unavailable" 2580 2580 msgstr "Post unavailable" 2581 2581 ··· 2612 2612 2613 2613 #: src/components/timeline.jsx:587 2614 2614 #: src/pages/home.jsx:228 2615 - #: src/pages/notifications.jsx:898 2615 + #: src/pages/notifications.jsx:899 2616 2616 #: src/pages/status.jsx:1099 2617 2617 #: src/pages/status.jsx:1550 2618 2618 msgid "Try again" ··· 3229 3229 msgid "No hashtags followed yet." 3230 3230 msgstr "" 3231 3231 3232 - #: src/pages/following.jsx:147 3232 + #: src/pages/following.jsx:145 3233 3233 msgid "Nothing to see here." 3234 3234 msgstr "" 3235 3235 3236 - #: src/pages/following.jsx:148 3236 + #: src/pages/following.jsx:146 3237 3237 #: src/pages/list.jsx:109 3238 3238 msgid "Unable to load posts." 3239 3239 msgstr "" ··· 3451 3451 msgid "Who are limited by server moderators" 3452 3452 msgstr "" 3453 3453 3454 - #: src/pages/notifications.jsx:605 3455 - #: src/pages/notifications.jsx:946 3454 + #: src/pages/notifications.jsx:606 3455 + #: src/pages/notifications.jsx:947 3456 3456 msgid "Notifications settings" 3457 3457 msgstr "" 3458 3458 3459 - #: src/pages/notifications.jsx:623 3459 + #: src/pages/notifications.jsx:624 3460 3460 msgid "New notifications" 3461 3461 msgstr "" 3462 3462 3463 3463 #. placeholder {0}: announcements.length 3464 - #: src/pages/notifications.jsx:634 3464 + #: src/pages/notifications.jsx:635 3465 3465 msgid "{0, plural, one {Announcement} other {Announcements}}" 3466 3466 msgstr "" 3467 3467 3468 - #: src/pages/notifications.jsx:681 3468 + #: src/pages/notifications.jsx:682 3469 3469 #: src/pages/settings.jsx:1206 3470 3470 msgid "Follow requests" 3471 3471 msgstr "" 3472 3472 3473 3473 #. placeholder {0}: followRequests.length 3474 - #: src/pages/notifications.jsx:686 3474 + #: src/pages/notifications.jsx:687 3475 3475 msgid "{0, plural, one {# follow request} other {# follow requests}}" 3476 3476 msgstr "" 3477 3477 3478 3478 #. placeholder {0}: notificationsPolicy.summary.pendingRequestsCount 3479 - #: src/pages/notifications.jsx:741 3479 + #: src/pages/notifications.jsx:742 3480 3480 msgid "{0, plural, one {Filtered notifications from # person} other {Filtered notifications from # people}}" 3481 3481 msgstr "" 3482 3482 3483 - #: src/pages/notifications.jsx:814 3483 + #: src/pages/notifications.jsx:815 3484 3484 msgid "Only mentions" 3485 3485 msgstr "" 3486 3486 3487 - #: src/pages/notifications.jsx:818 3487 + #: src/pages/notifications.jsx:819 3488 3488 msgid "Today" 3489 3489 msgstr "" 3490 3490 3491 - #: src/pages/notifications.jsx:823 3491 + #: src/pages/notifications.jsx:824 3492 3492 msgid "You're all caught up." 3493 3493 msgstr "" 3494 3494 3495 - #: src/pages/notifications.jsx:846 3495 + #: src/pages/notifications.jsx:847 3496 3496 msgid "Yesterday" 3497 3497 msgstr "" 3498 3498 3499 - #: src/pages/notifications.jsx:894 3499 + #: src/pages/notifications.jsx:895 3500 3500 msgid "Unable to load notifications" 3501 3501 msgstr "" 3502 3502 3503 - #: src/pages/notifications.jsx:973 3503 + #: src/pages/notifications.jsx:974 3504 3504 msgid "Notifications settings updated" 3505 3505 msgstr "" 3506 3506 3507 - #: src/pages/notifications.jsx:981 3507 + #: src/pages/notifications.jsx:982 3508 3508 msgid "Filter out notifications from people:" 3509 3509 msgstr "" 3510 3510 3511 - #: src/pages/notifications.jsx:995 3511 + #: src/pages/notifications.jsx:996 3512 3512 msgid "Filter" 3513 3513 msgstr "" 3514 3514 3515 - #: src/pages/notifications.jsx:998 3515 + #: src/pages/notifications.jsx:999 3516 3516 msgid "Ignore" 3517 3517 msgstr "" 3518 3518 3519 3519 #. placeholder {0}: niceDateTime(updatedAtDate) 3520 - #: src/pages/notifications.jsx:1071 3520 + #: src/pages/notifications.jsx:1072 3521 3521 msgid "Updated <0>{0}</0>" 3522 3522 msgstr "" 3523 3523 3524 3524 #. placeholder {0}: account.username 3525 - #: src/pages/notifications.jsx:1139 3525 + #: src/pages/notifications.jsx:1140 3526 3526 msgid "View notifications from <0>@{0}</0>" 3527 3527 msgstr "" 3528 3528 3529 3529 #. placeholder {0}: account.username 3530 - #: src/pages/notifications.jsx:1160 3530 + #: src/pages/notifications.jsx:1161 3531 3531 msgid "Notifications from <0>@{0}</0>" 3532 3532 msgstr "" 3533 3533 3534 3534 #. placeholder {0}: request.account.username 3535 - #: src/pages/notifications.jsx:1228 3535 + #: src/pages/notifications.jsx:1229 3536 3536 msgid "Notifications from @{0} will not be filtered from now on." 3537 3537 msgstr "" 3538 3538 3539 - #: src/pages/notifications.jsx:1233 3539 + #: src/pages/notifications.jsx:1234 3540 3540 msgid "Unable to accept notification request" 3541 3541 msgstr "" 3542 3542 3543 - #: src/pages/notifications.jsx:1238 3543 + #: src/pages/notifications.jsx:1239 3544 3544 msgid "Allow" 3545 3545 msgstr "" 3546 3546 3547 3547 #. placeholder {0}: request.account.username 3548 - #: src/pages/notifications.jsx:1258 3548 + #: src/pages/notifications.jsx:1259 3549 3549 msgid "Notifications from @{0} will not show up in Filtered notifications from now on." 3550 3550 msgstr "Notifications from @{0} will not show up in Filtered notifications from now on." 3551 3551 3552 - #: src/pages/notifications.jsx:1263 3552 + #: src/pages/notifications.jsx:1264 3553 3553 msgid "Unable to dismiss notification request" 3554 3554 msgstr "" 3555 3555 3556 - #: src/pages/notifications.jsx:1268 3556 + #: src/pages/notifications.jsx:1269 3557 3557 msgid "Dismiss" 3558 3558 msgstr "" 3559 3559 3560 - #: src/pages/notifications.jsx:1283 3560 + #: src/pages/notifications.jsx:1284 3561 3561 msgid "Dismissed" 3562 3562 msgstr "" 3563 3563 ··· 3595 3595 3596 3596 #. Scheduled [in 1 day] ([Thu, Feb 27, 6:30:00 PM]) 3597 3597 #. placeholder {0}: niceDateTime(scheduledAt, { formatOpts: { weekday: 'short', second: 'numeric', }, }) 3598 - #: src/pages/scheduled-posts.jsx:207 3598 + #: src/pages/scheduled-posts.jsx:206 3599 3599 msgid "Scheduled <0><1/></0> <2>({0})</2>" 3600 3600 msgstr "Scheduled <0><1/></0> <2>({0})</2>" 3601 3601 3602 3602 #. Scheduled [in 1 day] 3603 - #: src/pages/scheduled-posts.jsx:263 3603 + #: src/pages/scheduled-posts.jsx:262 3604 3604 msgid "Scheduled <0><1/></0>" 3605 3605 msgstr "Scheduled <0><1/></0>" 3606 3606 3607 - #: src/pages/scheduled-posts.jsx:308 3607 + #: src/pages/scheduled-posts.jsx:307 3608 3608 msgid "Scheduled post rescheduled" 3609 3609 msgstr "Scheduled post rescheduled" 3610 3610 3611 - #: src/pages/scheduled-posts.jsx:315 3611 + #: src/pages/scheduled-posts.jsx:314 3612 3612 msgid "Failed to reschedule post" 3613 3613 msgstr "Failed to reschedule post" 3614 3614 3615 - #: src/pages/scheduled-posts.jsx:338 3615 + #: src/pages/scheduled-posts.jsx:337 3616 3616 msgid "Reschedule" 3617 3617 msgstr "Reschedule" 3618 3618 3619 - #: src/pages/scheduled-posts.jsx:344 3619 + #: src/pages/scheduled-posts.jsx:343 3620 3620 msgid "Delete scheduled post?" 3621 3621 msgstr "Delete scheduled post?" 3622 3622 3623 - #: src/pages/scheduled-posts.jsx:352 3623 + #: src/pages/scheduled-posts.jsx:351 3624 3624 msgid "Scheduled post deleted" 3625 3625 msgstr "Scheduled post deleted" 3626 3626 3627 - #: src/pages/scheduled-posts.jsx:359 3627 + #: src/pages/scheduled-posts.jsx:358 3628 3628 msgid "Failed to delete scheduled post" 3629 3629 msgstr "Failed to delete scheduled post" 3630 3630
+7 -7
src/pages/catchup.jsx
··· 113 113 const supportsPixelfed = supports('@pixelfed/home-include-reblogs'); 114 114 115 115 async function fetchHome({ maxCreatedAt }) { 116 - const maxCreatedAtDate = maxCreatedAt ? new Date(maxCreatedAt) : null; 117 - console.debug('fetchHome', maxCreatedAtDate); 116 + const maxCreatedAtTime = maxCreatedAt ? Date.parse(maxCreatedAt) : null; 117 + console.debug('fetchHome', maxCreatedAtTime); 118 118 const allResults = []; 119 119 const homeIterable = masto.v1.timelines.home.list({ limit: 40 }); 120 120 const homeIterator = homeIterable.values(); ··· 135 135 let addedResults = false; 136 136 for (let i = 0; i < value.length; i++) { 137 137 const item = value[i]; 138 - const createdAtDate = new Date(item.createdAt); 139 - if (!maxCreatedAtDate || createdAtDate >= maxCreatedAtDate) { 138 + const createdAtTime = Date.parse(item.createdAt); 139 + if (!maxCreatedAtTime || createdAtTime >= maxCreatedAtTime) { 140 140 // Filtered 141 141 const selfPost = isSelf( 142 142 item.reblog?.account?.id || item.account.id, ··· 2098 2098 // Create empty bins and loop through data 2099 2099 const bins = Array.from({ length: numBins }, () => []); 2100 2100 data.forEach((item) => { 2101 - const date = new Date(item[key]); 2102 - if (date.getTime() > Date.now()) { 2101 + const dateTime = Date.parse(item[key]); 2102 + if (dateTime > Date.now()) { 2103 2103 // Future dates go into the last bin 2104 2104 bins[bins.length - 1].push(item); 2105 2105 } else { 2106 - const normalized = (date.getTime() - minDate.getTime()) / range; 2106 + const normalized = (dateTime - minDate.getTime()) / range; 2107 2107 const binIndex = Math.floor(normalized * (numBins - 1)); 2108 2108 bins[binIndex].push(item); 2109 2109 }
+2 -2
src/pages/filters.jsx
··· 304 304 // Other clients don't do this 305 305 if (hasExpiry) { 306 306 expiresIn = Math.floor( 307 - (expiresAtDate - new Date()) / 1000, 307 + (expiresAtDate - Date.now()) / 1000, 308 308 ); 309 309 } else { 310 310 expiresIn = null; ··· 615 615 const { t } = useLingui(); 616 616 const hasExpiry = !!expiresAt; 617 617 const expiresAtDate = hasExpiry && new Date(expiresAt); 618 - const expired = hasExpiry && expiresAtDate <= new Date(); 618 + const expired = hasExpiry && Date.parse(expiresAt) <= Date.now(); 619 619 620 620 // If less than a minute left, re-render interval every second, else every minute 621 621 const [_, rerender] = useReducer((c) => c + 1, 0);
+1 -3
src/pages/following.jsx
··· 71 71 72 72 // ENFORCE sort by datetime (Latest first) 73 73 value.sort((a, b) => { 74 - const aDate = new Date(a.createdAt); 75 - const bDate = new Date(b.createdAt); 76 - return bDate - aDate; 74 + return Date.parse(b.createdAt) - Date.parse(a.createdAt); 77 75 }); 78 76 } 79 77 __BENCHMARK.end('fetch-home-first');
+4 -3
src/pages/notifications.jsx
··· 279 279 .then((announcements) => { 280 280 announcements.sort((a, b) => { 281 281 // Sort by updatedAt first, then createdAt 282 - const aDate = new Date(a.updatedAt || a.createdAt); 283 - const bDate = new Date(b.updatedAt || b.createdAt); 284 - return bDate - aDate; 282 + return ( 283 + Date.parse(b.updatedAt || b.createdAt) - 284 + Date.parse(a.updatedAt || a.createdAt) 285 + ); 285 286 }); 286 287 setAnnouncements(announcements); 287 288 })
+1 -2
src/pages/scheduled-posts.jsx
··· 187 187 function ScheduledPostPreview({ status, scheduledAt, onClick }) { 188 188 // Look at scheduledAt, if it's months away, ICON = 'month'. If it's days away, ICON = 'day', else ICON = 'time' 189 189 const icon = useMemo(() => { 190 - const hours = 191 - (new Date(scheduledAt).getTime() - Date.now()) / (1000 * 60 * 60); 190 + const hours = (Date.parse(scheduledAt) - Date.now()) / (1000 * 60 * 60); 192 191 if (hours < 24) { 193 192 return 'time'; 194 193 } else if (hours < 720) {
+1 -1
src/pages/status.jsx
··· 272 272 273 273 // oldest first 274 274 function createdAtSort(a, b) { 275 - return new Date(b.created_at) - new Date(a.created_at); 275 + return Date.parse(b.created_at) - Date.parse(a.created_at); 276 276 } 277 277 278 278 const MONTH_IN_MS = 1000 * 60 * 60 * 24 * 30;
+1 -1
src/utils/filters.js
··· 8 8 const hasContext = filter.context.includes(filterContext); 9 9 if (!hasContext) return false; 10 10 if (!filter.expiresAt) return hasContext; 11 - return new Date(filter.expiresAt) > new Date(); 11 + return Date.parse(filter.expiresAt) > Date.now(); 12 12 }); 13 13 if (!appliedFilters.length) return false; 14 14 const isHidden = appliedFilters.some((f) => f.filter.filterAction === 'hide');
+3 -5
src/utils/timeline-utils.js
··· 126 126 contexts.forEach((context) => { 127 127 context.sort((a, b) => { 128 128 if (!a.inReplyToId && !b.inReplyToId) { 129 - return new Date(a.createdAt) - new Date(b.createdAt); 129 + return Date.parse(a.createdAt) - Date.parse(b.createdAt); 130 130 } 131 131 if (a.inReplyToId === b.id) return 1; 132 132 if (b.inReplyToId === a.id) return -1; 133 133 if (!a.inReplyToId) return -1; 134 134 if (!b.inReplyToId) return 1; 135 - return new Date(a.createdAt) - new Date(b.createdAt); 135 + return Date.parse(a.createdAt) - Date.parse(b.createdAt); 136 136 }); 137 137 }); 138 138 ··· 161 161 if (appliedContextIndices.includes(i)) return; 162 162 const contextItems = contexts[i]; 163 163 contextItems.sort((a, b) => { 164 - const aDate = new Date(a.createdAt); 165 - const bDate = new Date(b.createdAt); 166 - return aDate - bDate; 164 + return Date.parse(a.createdAt) - Date.parse(b.createdAt); 167 165 }); 168 166 const firstItemAccountID = contextItems[0].account.id; 169 167 newItems.push({