File tree Expand file tree Collapse file tree 3 files changed +4
-19
lines changed Expand file tree Collapse file tree 3 files changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ export const MOCK_USER: User = {
1919 signatures : [
2020 {
2121 edition : MOCK_EVENT . id ,
22- day : new Date ( ) . toISOString ( ) ,
22+ day : new Date ( ) . getDate ( ) . toString ( ) ,
2323 redeemed : false ,
2424 signatures : MOCK_ACHIEVEMENTS . filter (
2525 ( a ) => a . kind === "stand" && a . users ?. includes ( "mock_user_id" )
@@ -48,7 +48,7 @@ export const MOCK_OTHER_USER: User = {
4848 signatures : [
4949 {
5050 edition : MOCK_EVENT . id ,
51- day : new Date ( ) . toISOString ( ) ,
51+ day : new Date ( ) . getDate ( ) . toString ( ) ,
5252 redeemed : false ,
5353 signatures : MOCK_ACHIEVEMENTS . filter (
5454 ( a ) => a . kind === "stand" && a . users ?. includes ( "other_user_id_1" )
Original file line number Diff line number Diff line change 11export function isHereToday ( company : Company ) : boolean {
22 const today = new Date ( ) . toISOString ( ) . slice ( 0 , 10 ) ;
3- return company . stands ?. some ( ( s ) => s . date === today ) || false ;
3+ return company . stands ?. some ( ( s ) => s . date . slice ( 0 , 10 ) === today ) || false ;
44}
Original file line number Diff line number Diff line change @@ -124,21 +124,6 @@ export function getAchievementFromQRCode(data: string): string | null {
124124 return JSON . parse ( atob ( data . split ( "sinfo://" ) [ 1 ] ) ) . achievement as string ;
125125}
126126
127- export function isToday ( date : Date | string ) : boolean {
128- if ( typeof date === "string" ) {
129- date = new Date ( date ) ;
130- if ( isNaN ( date . getTime ( ) ) ) return false ;
131- }
132-
133- const today = new Date ( ) ;
134-
135- return (
136- date . getFullYear ( ) === today . getFullYear ( ) &&
137- date . getMonth ( ) === today . getMonth ( ) &&
138- date . getDate ( ) === today . getDate ( )
139- ) ;
140- }
141-
142127export function getSessionColor ( sessionKind : string ) {
143128 switch ( sessionKind ) {
144129 case "Presentation" :
@@ -154,7 +139,7 @@ export function getSessionColor(sessionKind: string) {
154139
155140export function getUserActiveSignatureData ( user : User , edition : string ) {
156141 let relevantSignatures = user . signatures ?. find (
157- ( s ) => s . edition === edition && isToday ( s . day )
142+ ( s ) => s . edition === edition && new Date ( ) . getDate ( ) . toString ( ) === s . day ,
158143 ) ;
159144 if ( ! relevantSignatures ) return null ;
160145
You can’t perform that action at this time.
0 commit comments