jwkent / AudioWebApp

An audio web app
2 stars 2 forks source link

Rewrite liveRadioTimeCheck.js to account for Daylight Savings #110

Closed javierxio closed 2 months ago

javierxio commented 3 months ago

@benjkent I rewrote this code to account for daylight savings which the time changes twice a year. I have tested this on my local machine. Please also see if you can accept it. Thanks.

JacksonKearl commented 2 months ago

It would perhaps be easier to use the Intl builtin object, which is better designed for this operation:

const parts = new Intl.DateTimeFormat('en-US', {
    timeZone: "America/Los_Angeles", 
    hour: "numeric", 
    hour12: false, 
    weekday: 'long',
}).formatToParts(new Date())

const day = parts.find(p => p.type === 'weekday')
const hour = parts.find(p => p.type === 'hour')

return hour.value === '14' && day.value !== 'Saturday' && day.value !== 'Sunday'
javierxio commented 2 months ago

@JacksonKearl thanks for the code. it seems working on my side. You may want to create a pull request and I can close this one?

JacksonKearl commented 2 months ago

I'm not sure exactly how to run this project, does it work with VS Code or do I need a Visual Studio setup?

JacksonKearl commented 2 months ago

Okay I've been able to build the basic skeleton of the app, but it's missing a lot of CSS and all the content. Any ideas on how to get this working beyond a basic dotnet watch?

JacksonKearl commented 2 months ago

Ah, on macOS the AudioWebApp.Client.styles.css is case sensitive.

javierxio commented 2 months ago

I will close this PR and can be replaced by https://github.com/jwkent/AudioWebApp/pull/123

benjkent commented 1 month ago

Thanks for all the work. Looks good, I will test it on Monday and Tuesday. On Tuesday, April 30, 2024 at 11:32:17 AM PDT, javierxio @.***> wrote:

I will close this PR and can be replaced by #123

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>