Announcement

Collapse
No announcement yet.

Check if date is a holiday

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Check if date is a holiday

    Discussion thread for scripts that returns the holidays/events that occur on a given day. The scripts are located here. Also includes an ASP based calendar page that shows the events/holidays.

    Feedback would be appreciated!

    Cheers
    Al
    Last edited by sparkman; October 5, 2012, 01:42 AM.
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    #2
    Hi all,

    Released version 1.2 to fix a bug in the Easter portion of the script. If you've previously downloaded the script, simply overwrite isholiday.asp and isholiday.vbs.

    To get the latest rev, go here.

    I see a few people have downloaded it so far. Any feedback? Is it working/not working/etc.?

    Cheers
    Al

    [This message was edited by Sparkman on Tue, 16 December 2003 at 12:28 AM.]
    Last edited by sparkman; October 5, 2012, 01:42 AM.
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #3
      Thanks Sparkman for a great script. I was working on one EXACTLY like this over the past month or so. A lot of people were offering ideas, suggestions & advice for calculating certain dates. You can view the thread HERE.

      I instaled your script and it works perfectly. I stopped the one I was working on, as this fills what I need now. I did take a few of the items from the one I was working on and incorporated them. I added other U.S. holidays such as mothers day, Fathers day, Tax deadline date, Daylight savings time, St. Patty's day ect ect..

      I also wrote a script to remind me of upcomming dates up to 7 days in advance. I needed something to remind me of birthday's, anniversaries, secretaries day (I forgot this one year before last, and it wasn't pretty!) ect. Knowing on the day itself was too late in most cituations.

      I set it as part of my "waking up script". It will announce for instance that: "Linda's birthday is 3 days away", "Day after tommorrow is St. Patty's day", "Christmas is next Thursday" ect.

      If anyone would like the scirpt, let me know and I will post it. Maby it will come in handy for someone else out there as well.

      - "Home automation is no longer a thing of the future"
      Visit My Home Seer Site at:
      www.JohnWPB.com
      Created with LCARS

      Comment


        #4
        Hi John,

        Glad it's working for you. Unfortunately, I didn't find the thread about the one you were writing until after I had posted mine. Would have saved some work

        I'd like to use your holiday announcement script, so please post it. I'm sure others will find it useful as well. I know how painful missing Secretaries day can be as well

        Also, if you can email me your INI file, I'll add the additional entries to the default INI file. You can email me at sparkmanwebATshaw.ca (replace AT with @).

        Cheers
        Al
        HS 4.2.8.0: 2134 Devices 1252 Events
        Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

        Comment


          #5
          I'd like to see it. This is something I had set up years ago in my first ha setup, but forgot about somewhere along the way...

          --------------
          -=A.J. Griglak

          Comment


            #6
            [Great screename and avatar by the way]

            I just downloaded and installed it. The .asp part threw me off at first - I thought it was a web only deal.

            I wrote a simple script to test it, changed my computer date to nex Thursday (can't believe it's that close!) and it worked perfectly.

            I will incorporate it into my setup. I will probably create a virtual device that will be on if it's a holiday and off if not. This could be used for altering wake up scripts for example. A check could be done daily at midnight:01 and set the flag.

            --------------
            -=A.J. Griglak

            Comment


              #7
              Hi all,

              Whipped up an ASP based calendar that's based on some VBScript code that I found on the web. It'll display the entries from the INI file. The file is called cal.asp and is included in the latest version of the ZIP file. Just save it into any HomeSeer HTML folder and open in a browser.

              Cheers
              Al
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment


                #8
                Hi A.J.

                Glad it's working for you!

                I've had the nickname Sparkman for a long time (and no, it's got nothing to do with me being an Electrical Engineer ). Took a while to find an Avatar that matched the name, but it seems to be a good fit...

                Cheers
                Al
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment


                  #9
                  Sparkman
                  UK systems format the date in a different order, ie
                  dd/mm/yyyy

                  I have adjusted your script to suit as follows

                  boxWidth = "70"
                  boxHeight = "50"
                  incDate = Request.QueryString("incDate")
                  If Not incDate <> "" Then
                  'Get the current months first day
                  'incDate = DatePart ("m" , Date) & "/01/" & DatePart("yyyy" , Date) 'us
                  incDate = "01/" & DatePart ("m" , Date) & "/"& DatePart("yyyy" , Date) 'uk

                  End If

                  %>
                  <br><center>

                  and added a couple of extra lines for spacing and to centre (UK english!) the calendar. There is a corresponding </center> (!) at the end of the asp

                  Thanks
                  Kevin

                  Comment


                    #10
                    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by kev_t:
                    Sparkman
                    UK systems format the date in a different order, ie
                    dd/mm/yyyy
                    <HR></BLOCKQUOTE>Never understood that...

                    Sometimes I think things are done differently just for the sake of being different.

                    ie: color and colour

                    --------------
                    -=A.J. Griglak

                    Comment


                      #11
                      Hey, I just had an idea...

                      How about the inclusion in the .ini file of a phrase applicable to particular holiday. For example, Christmas - "Merry Christmas" & birthdays - "Happy birthday Jane".

                      --------------
                      -=A.J. Griglak

                      Comment


                        #12
                        "Never understood that...

                        Sometimes I think things are done differently just for the sake of being different.

                        ie: color and colour"

                        It is bad enough when the words look similar, but mean the same, it is when the same words mean different things, eg rubber and eraser, or light switches that go different ways for on, that confusion really occurs!

                        Kevin

                        [This message was edited by kev_t on Tue, 16 December 2003 at 07:31 PM.]

                        Comment


                          #13
                          To save others a little typing here is the ini file for the UK
                          [Holidays]
                          New Year's Day=January 1
                          Christmas Day=December 25
                          Boxing Day=December 26
                          Good Friday=Good Friday
                          Easter=Easter
                          May Day=May 3,2004
                          May Day=May 2,2005
                          Spring Bank Holiday=May 31,2004
                          Spring Bank Holiday=May 30,2005
                          Summer Bank Holiday=August 30,2004
                          Summer Bank Holiday=August 29,2005
                          Bank Holiday=December 27,2004
                          Bank Holiday=December 26,2005
                          Bank Holiday=December 28,2004
                          Bank Holiday=December 27,2005

                          Before anyone points it out , This is for UK, not Scotland or Northern Ieland which has slightly different Bank Holiday dates

                          Kevin

                          Comment


                            #14
                            Like your script, but had a few problems making it work in the UK because of the date format difference.

                            In addition to the mods above I have made some additional changes of the same sort to do with highlighting the current day. For some reason the date function returned a 2 digit date (despite what control panel was set to ) so I had to build the date from its components.

                            Not elegant, but it works

                            Kevin

                            (Please dont download this unless you are in the UK)

                            Attached file removed since the one in the package now works for UK

                            [This message was edited by kev_t on Sat, 20 December 2003 at 09:19 AM.]

                            Comment


                              #15
                              Hi all,

                              Kevin, thanks for the mods. Did only cal.asp have problems with the date/time format? If so, I'll see if I can rewrite it to be non-locale specific. Also, is there any rime or reason as to what days May day and Bank holidays fall on? What's the purpose of a Bank holiday? Is that when the banks are closed, or are they days off when everybody goes to the bank

                              A.J., great suggestion! I was also looking at maybe adding a section to the ini file called "events" or something like that. In this you could list events that you would want to be reminded about or wanted shown on a calendar, but you wouldn't change the behavior of any other scripts on those days. As an example for my wakeup script, I wouldn't want the stereo to be turned on at 7 am on Christmas day, but on Secretaries day, I would want to. Any thoughts on this?

                              There's also an "undocumented feature" (i.e. bug) that if you have two events on the same day, it'll only tell you/display the last one. For example if you have the following:

                              Christmas=December 25
                              Uncle Bob's Birthday=December 25

                              The function only tells you that it's Uncle Bob's birthday.

                              One way to fix it is by using the following entry instead:

                              Christmas and Uncle Bob's Birthday=December 25

                              Do people see this as an issue?

                              Another way to fix it would be to pass back an array with all of the events for that day along with things like what phrase to use, etc. This will address it, but make the use of the function a bit more complex. Thoughts on this?

                              Cheers
                              Al
                              HS 4.2.8.0: 2134 Devices 1252 Events
                              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                              Comment

                              Working...
                              X