File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,17 +104,23 @@ <h3 class="subsubtitle question">{{ qanda.question }}</h3>
104104 ( function updateTimer ( ) {
105105 let now = new Date ( ) . getTime ( ) ;
106106 let distance = countDownDate - now ;
107- let days = Math . floor ( distance / ( 1000 * 60 * 60 * 24 ) ) ;
108- let hours = Math . floor ( ( distance % ( 1000 * 60 * 60 * 24 ) ) / ( 1000 * 60 * 60 ) ) ;
109- let minutes = Math . floor ( ( distance % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) ) ;
110- let seconds = Math . floor ( ( distance % ( 1000 * 60 ) ) / 1000 ) ;
111-
112- document . getElementById ( "count" ) . innerHTML = days + " <span>days</span> " + hours + " <span>hours</span> "
113- + minutes + " <span>minutes</span> " + seconds + " <span>seconds</span>" ;
114107
115108 if ( distance < 0 ) {
116- document . getElementById ( "count" ) . innerHTML = "<a href='https://cssbham.com/join'>cssbham.com/join</a>" ;
109+ let attendees = parseInt ( '{{ ball.attendees }}' ) || 0
110+ if ( attendees > 0 ) {
111+ document . getElementById ( "count" ) . innerHTML = `Attendees: ${ attendees } ` ;
112+ } else {
113+ document . getElementById ( "count" ) . innerHTML = "<a href='https://cssbham.com/join'>cssbham.com/join</a>" ;
114+ }
117115 } else {
116+ let days = Math . floor ( distance / ( 1000 * 60 * 60 * 24 ) ) ;
117+ let hours = Math . floor ( ( distance % ( 1000 * 60 * 60 * 24 ) ) / ( 1000 * 60 * 60 ) ) ;
118+ let minutes = Math . floor ( ( distance % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) ) ;
119+ let seconds = Math . floor ( ( distance % ( 1000 * 60 ) ) / 1000 ) ;
120+
121+ document . getElementById ( "count" ) . innerHTML = days + " <span>days</span> " + hours + " <span>hours</span> "
122+ + minutes + " <span>minutes</span> " + seconds + " <span>seconds</span>" ;
123+
118124 setTimeout ( updateTimer , 1000 )
119125 }
120126 } ) ( ) ;
Original file line number Diff line number Diff line change @@ -104,17 +104,23 @@ <h3 class="subsubtitle question">{{ qanda.question }}</h3>
104104 ( function updateTimer ( ) {
105105 let now = new Date ( ) . getTime ( ) ;
106106 let distance = countDownDate - now ;
107- let days = Math . floor ( distance / ( 1000 * 60 * 60 * 24 ) ) ;
108- let hours = Math . floor ( ( distance % ( 1000 * 60 * 60 * 24 ) ) / ( 1000 * 60 * 60 ) ) ;
109- let minutes = Math . floor ( ( distance % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) ) ;
110- let seconds = Math . floor ( ( distance % ( 1000 * 60 ) ) / 1000 ) ;
111-
112- document . getElementById ( "count" ) . innerHTML = days + " <span>days</span> " + hours + " <span>hours</span> "
113- + minutes + " <span>minutes</span> " + seconds + " <span>seconds</span>" ;
114107
115108 if ( distance < 0 ) {
116- document . getElementById ( "count" ) . innerHTML = "<a href='https://cssbham.com/join'>cssbham.com/join</a>" ;
109+ let attendees = parseInt ( '{{ ball.attendees }}' ) || 0
110+ if ( attendees > 0 ) {
111+ document . getElementById ( "count" ) . innerHTML = `Attendees: ${ attendees } ` ;
112+ } else {
113+ document . getElementById ( "count" ) . innerHTML = "<a href='https://cssbham.com/join'>cssbham.com/join</a>" ;
114+ }
117115 } else {
116+ let days = Math . floor ( distance / ( 1000 * 60 * 60 * 24 ) ) ;
117+ let hours = Math . floor ( ( distance % ( 1000 * 60 * 60 * 24 ) ) / ( 1000 * 60 * 60 ) ) ;
118+ let minutes = Math . floor ( ( distance % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) ) ;
119+ let seconds = Math . floor ( ( distance % ( 1000 * 60 ) ) / 1000 ) ;
120+
121+ document . getElementById ( "count" ) . innerHTML = days + " <span>days</span> " + hours + " <span>hours</span> "
122+ + minutes + " <span>minutes</span> " + seconds + " <span>seconds</span>" ;
123+
118124 setTimeout ( updateTimer , 1000 )
119125 }
120126 } ) ( ) ;
You can’t perform that action at this time.
0 commit comments