File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8972,12 +8972,14 @@ exports.reactToComment = reactToComment;
89728972function getNextVoteDate() {
89738973 const now = new Date();
89748974 const year = now.getFullYear();
8975+ // Today at 00:00. We compare dates (not times).
8976+ const today = new Date(year, now.getMonth(), now.getDate());
89758977 const schedule = [
89768978 new Date(year, 0 /* Jan */, 30),
89778979 new Date(year, 4 /* May */, 30),
89788980 new Date(year, 8 /* Sep */, 30),
89798981 ];
8980- const next = schedule.find(d => d > now );
8982+ const next = schedule.find(d => d > today );
89818983 const nextDate = next !== null && next !== void 0 ? next : new Date(year + 1, schedule[0].getMonth(), schedule[0].getDate());
89828984 return nextDate.toLocaleDateString('en-US', {
89838985 month: 'long',
Original file line number Diff line number Diff line change @@ -67,13 +67,16 @@ function getNextVoteDate() {
6767 const now = new Date ( ) ;
6868 const year = now . getFullYear ( ) ;
6969
70+ // Today at 00:00. We compare dates (not times).
71+ const today = new Date ( year , now . getMonth ( ) , now . getDate ( ) )
72+
7073 const schedule = [
7174 new Date ( year , 0 /* Jan */ , 30 ) ,
7275 new Date ( year , 4 /* May */ , 30 ) ,
7376 new Date ( year , 8 /* Sep */ , 30 ) ,
7477 ] ;
7578
76- const next = schedule . find ( d => d > now ) ;
79+ const next = schedule . find ( d => d > today ) ;
7780 const nextDate = next ?? new Date ( year + 1 , schedule [ 0 ] ! . getMonth ( ) , schedule [ 0 ] ! . getDate ( ) ) ;
7881
7982 return nextDate . toLocaleDateString ( 'en-US' , {
You can’t perform that action at this time.
0 commit comments