@@ -20,7 +20,7 @@ export interface FreebuffModelOption {
2020/** Server-facing fallback copy for APIs and provider errors that can't know
2121 * the caller's local timezone. The CLI should render
2222 * `getFreebuffDeploymentAvailabilityLabel()` instead. */
23- export const FREEBUFF_DEPLOYMENT_HOURS_LABEL = '9am ET-5pm PT'
23+ export const FREEBUFF_DEPLOYMENT_HOURS_LABEL = '9am ET-5pm PT every day '
2424export const FREEBUFF_GLM_MODEL_ID = 'z-ai/glm-5.1'
2525export const FREEBUFF_MINIMAX_MODEL_ID = 'minimax/minimax-m2.7'
2626const FREEBUFF_EASTERN_TIMEZONE = 'America/New_York'
@@ -165,34 +165,11 @@ function getUtcForZonedTime(
165165 return guess
166166}
167167
168- function isWeekend (
169- parts : Pick < ZonedDateParts , 'year' | 'month' | 'day' > ,
170- ) : boolean {
171- const weekday = getWeekdayIndex ( parts )
172- return weekday === 0 || weekday === 6
173- }
174-
175- function getWeekdayIndex (
176- parts : Pick < ZonedDateParts , 'year' | 'month' | 'day' > ,
177- ) : number {
178- return new Date ( Date . UTC ( parts . year , parts . month - 1 , parts . day ) ) . getUTCDay ( )
179- }
180-
181168function getNextFreebuffDeploymentStart ( now : Date ) : Date {
182169 const easternNow = getZonedParts ( now , FREEBUFF_EASTERN_TIMEZONE )
183- const weekday = getWeekdayIndex ( easternNow )
184170 const isBeforeTodayOpen = easternNow . hour < 9
185171
186- const offset =
187- weekday === 6
188- ? 2
189- : weekday === 0
190- ? 1
191- : isBeforeTodayOpen
192- ? 0
193- : weekday === 5
194- ? 3
195- : 1
172+ const offset = isBeforeTodayOpen ? 0 : 1
196173
197174 return getUtcForZonedTime (
198175 addDaysToYmd ( easternNow . year , easternNow . month , easternNow . day , offset ) ,
@@ -241,17 +218,16 @@ export function getFreebuffDeploymentAvailabilityLabel(
241218) : string {
242219 if ( isFreebuffDeploymentHours ( now ) ) {
243220 const closesAt = getCurrentFreebuffDeploymentEnd ( now )
244- return `until ${ formatLocalTime ( closesAt , now , options ) } local `
221+ return `until ${ formatLocalTime ( closesAt , now , options ) } `
245222 }
246223
247224 const opensAt = getNextFreebuffDeploymentStart ( now )
248- return `opens ${ formatLocalTime ( opensAt , now , options ) } local `
225+ return `opens ${ formatLocalTime ( opensAt , now , options ) } `
249226}
250227
251228export function isFreebuffDeploymentHours ( now : Date = new Date ( ) ) : boolean {
252229 const eastern = getZonedParts ( now , FREEBUFF_EASTERN_TIMEZONE )
253230 const pacific = getZonedParts ( now , FREEBUFF_PACIFIC_TIMEZONE )
254- if ( eastern . weekday === 'Sat' || eastern . weekday === 'Sun' ) return false
255231 return (
256232 eastern . hour * 60 + eastern . minute >= 9 * 60 &&
257233 pacific . hour * 60 + pacific . minute < 17 * 60
0 commit comments