Announcement

Collapse
No announcement yet.

Check if date is a holiday

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

    #61
    Hi Kevin and Speedy,

    I'm working on the new version and have a couple of questions about your suggestions/requests:

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by kev_t:
    Would it be possible for the script to calculate a value for anniversaries and birthdays, given a start date and a value on that date, and perhaps a prefix/suffix to wrap around the number

    eg
    prefix=""
    suffix="years old"
    year=1999
    value=10

    or
    prefix=""
    suffix="years married!"
    year=1975
    value=0

    The result could could be used in the calendar, announcements, emails or whatever.

    (I need all the help I can get, particularly for wedding anniversaries!)

    Kevin<HR></BLOCKQUOTE>

    Kevin, would one parameter called 'year' do instead of 'year' and 'value'? That way the year that would need to be entered would be the "year 0" year (e.g. in your first example you would enter 1989).

    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Sparkman:
    I'm working on a new version that will allow for customization of pretty much everything on the calendar. It won't be style sheet based so that it will allow for multiple settings so that if you have machines with different resolutions, you can customize each one (based on IP address). I should have something this weekend, and it'll include a "goto today" link as well.
    <HR></BLOCKQUOTE>

    Speedy, when working on this, I changed my mind and the customization will now style sheet based, but it uses a separate style sheet. For customization based on IP address, a different style sheet would be loaded (if it exists). Let me know if this will meet your needs.

    Cheers
    Al

    http://www.sparkman.dns2go.com/

    [This message was edited by Sparkman on Sun, 11 January 2004 at 08:38 PM.]
    HS 4.2.8.0: 2134 Devices 1252 Events
    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

    Comment


      #62
      sparkman...

      A seperate style sheet would do the job just fine.

      nice one.

      Comment


        #63
        I would be pleased if you implemented the idea at all

        My original idea was that if I was told my niece was 10 this year I wouldnt have to do any arithmetic! (not my strongest point and since i have a computer...)

        Thanks Kevin

        Comment


          #64
          You have been busy

          Thanks

          Kevin

          Comment


            #65
            Hi all,

            Version 3.0 of the package has been released and is available here. The changes in the new version:

            <UL TYPE=SQUARE>
            <LI>the function will return additional parameters (Person, Time and which anniversary or birthday it is).
            <LI>the on-screen calendar is now style sheet based, so it's easily customizable. You can also create style sheets for specific machines (based on IP address), which is handy if you have machines with different resolutions.
            <LI>the on-screen calendar will display what time the event is (if set),
            <LI>the on-screen calendar can display events for different people using different style fonts.
            <LI>a new small calendar is included.
            <LI>the text on the calendar and the edit screen can be set to whatever you want (like a different language). The settings are in cal.ini in the config folder. If anyone creates a new version for a different language, please post it.
            <LI>bug fixes including: displaying the weekdays using the correct language, additional syntax and error checking, the ability to open caledit.asp directly instead of just by clicking on dates in cal.asp.[/list]
            More details of the new functionality is provided here.

            Screen shots of the calendars are shown below. The new version is backwards compatible with the older INI file, but there are new parameters available. To upgrade, I recommend that you make a backup copy of your INI file, save the new one in the config folder and then copy your [Holidays] and specific event sections over. The calendar files are now placed in the /html/cal folder to minimize the clutter in the /html folder. If you've saved the previous version files in the /html directory you can delete them from there(cal.asp,caledit.asp ,todayholiday.asp).

            Feedback, as always, is welcome.

            Cheers
            Al

            See the calendar in action here: http://www.sparkman.dns2go.com/cal/cal.asp

            [This message was edited by Sparkman on Mon, 12 January 2004 at 02:23 AM.]
            HS 4.2.8.0: 2134 Devices 1252 Events
            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

            Comment


              #66
              Picture of on-screen calendar
              Attached Files
              HS 4.2.8.0: 2134 Devices 1252 Events
              Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

              Comment


                #67
                Picture of small calendar
                Attached Files
                HS 4.2.8.0: 2134 Devices 1252 Events
                Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                Comment


                  #68
                  Sparkman,

                  Thanks for sharing this excellent script collection and thanks for the detailed documentation also. The time and effort you put into this really shows.

                  I’ve got the calendar up and running without a hitch and next I’m planning on integrating this script with my BetaBrite to display holiday and birthday wishes. I’m going to utilize the remind prior field to display upcoming events with messages like – Only 14 shopping days till Dad’s birthday!

                  I did notice one small formatting discrepancy regarding private events when viewing cal.asp.as a guest vs. as an authorized user. If there is a date that has more than one event but only one event is public, the guest view shows an unnecessary – in front of the one public event.

                  For example, I added a new event on New Years Day called Private and I set private true. When I view January as an authorized user, January 1 correctly shows this:

                  - New Year’s
                  Day
                  -Private

                  When I view January as a guest , January 1 shows this:

                  - New Year’s
                  Day

                  When it should really only show this:

                  New Year’s
                  Day

                  Thanks again for this very cool script. I can see a lot of uses for it.

                  Joe
                  HomeSeer Rocks!

                  Comment


                    #69
                    Hi Joe,

                    Thanks for the kind words! That's a great idea about reminding everyone to buy you presents. I'll have to set that up to remind my wife

                    I'll be releasing a new version this weekend which includes a couple of small functionality additions and a few bug fixes. The bug you've identified will be fixed as well.

                    Cheers
                    Al

                    http://www.sparkman.dns2go.com/
                    HS 4.2.8.0: 2134 Devices 1252 Events
                    Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                    Comment


                      #70
                      Hi all,

                      Version 3.1 of the package has been released and is available here. The changes in the new version:

                      <UL TYPE=SQUARE>
                      <LI>some minor bug fixes
                      <LI>You can customize whether to open the edit window (caledit.asp), by either clicking or double-clicking. Set this by changing the DoubleClick option in cal.ini
                      <LI>You can create a drop down list in the Edit window for the Person field, by setting the Persons setting in cal.ini. As an example, to display Bob and Roberta in the drop down list, set the entry to Persons=Bob,Roberta. If you leave this blank, no drop down list is created and a regular text field is used instead.
                      <LI>The separator used to display multiple entries on the same day can be customized by setting the Separator entry in cal.ini.[/list]

                      If you are already using the package, upgrade by overwriting cal.asp, cal2.asp and caledit.asp.

                      Feedback, as always, is welcome.

                      Cheers
                      Al

                      http://www.sparkman.dns2go.com/
                      HS 4.2.8.0: 2134 Devices 1252 Events
                      Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                      Comment


                        #71
                        I have been playing with the calendar script environment . nice job ! and want to try out a few features - mail notifications;

                        I can not get mail to trigger. I modified the .ini for email address

                        ..."Email email address. Set this to the email address that you want a script to use to send emails to. NOTE: This parameter is not used in any of the scripts provided."

                        Is this feature implimented in my 3.1 ?
                        If so how is it triggered?

                        I placed an event for 5:00 PM on saturday the 1/17/ and when I ran the wakeup2.txt the item was announced but this also happened after 5:00 PM
                        so that was an error?

                        Is there any notification acknowledge function?

                        I think this calendar should be a integrated part of HS. My (up to this point) calendar / reminders
                        activities just got a big boost with this script projects. Thanks again !!

                        What I do with it includes;
                        home maintenance filters, pool chores
                        dog health reminders
                        garden reminders (replaces the Scotts email reminder system)

                        garbage day announcements for chores
                        tax quarter filings
                        Dr appointments
                        purchase household supplies reminders (those on a cycle)
                        holiday controls (if it is a holiday then xyz)

                        work reminders
                        family schedules

                        All under HS . YES !!

                        Richard
                        HS3 Standard Edition 3.0.0.258

                        Comment


                          #72
                          Hi Richard,

                          Glad you find the package useful! As a summary answer to your questions, IsHoliday was intended as a function that could be incorporated in other scripts and ASP pages, and would return parameters that these other scripts could act on. The ASP pages and scripts that were included were more meant as examples of how to use the function. Therefore some of the parameters that are available have not (yet) been included in any of the provided scripts or in other users' scripts.

                          <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by Richard G:
                          I can not get mail to trigger. I modified the .ini for email address

                          ..."Email email address. Set this to the email address that you want a script to use to send emails to. NOTE: This parameter is not used in any of the scripts provided."

                          Is this feature implimented in my 3.1 ?
                          If so how is it triggered?
                          <HR></BLOCKQUOTE>
                          The email parameter is not implemented in any of the current scripts and I have no plans to implement it at this point in time. To use this parameter a script would have to be written that would send an email to the email address the function returns. As examples, wakeup2.txt could be modified to send emails instead of announce (or do both), or a new script that would send emails for birthdays, etc.

                          <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>
                          I placed an event for 5:00 PM on saturday the 1/17/ and when I ran the wakeup2.txt the item was announced but this also happened after 5:00 PM
                          so that was an error?
                          <HR></BLOCKQUOTE>
                          Wakeup2.txt was written before the "time" parameter was available and the intent of the script was to announce upcoming events for the day. The script would need to be modified to not announce if the time for that event had passed.

                          Try replacing the "Today" section in wakeup2.txt with the following:

                          <pre class="ip-ubbcode-code-pre">
                          myDate = Date
                          Holiday = WhichHolidays(myDate)
                          If IsArray( Holiday ) Then
                          For i = 0 To uBound(Holiday) - 1
                          If Holiday(i,ihAnnounce) = True Then
                          TempTime = ""
                          On Error Resume Next
                          TempTime = CDate(Holiday(i,ihTime))
                          If TempTime = "" Or DateDiff("n",TempTime,Time) &lt; 0 Then hs.speak Holiday(i,ihAnnouncement) & "."
                          End If
                          Next
                          End If
                          </pre>

                          If it works, I'll include it in a future version.
                          <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>
                          Is there any notification acknowledge function?
                          <HR></BLOCKQUOTE>
                          The function is completely stateless, so doesn't have this right now. One way to implement an acknowledge function (to prevent events from being announced again, etc.) is by changing the Announce and/or Remind parameters to "False" for those specific events through a script or ASP page. You'd have to be careful because for recurring events, you may need to turn these parameters back to "True" for when they occur again. I'm not sure if something could be implmented globally, because everyone's needs will be different. Thoughts?

                          Cheers
                          Al

                          http://www.sparkman.dns2go.com/
                          HS 4.2.8.0: 2134 Devices 1252 Events
                          Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                          Comment


                            #73
                            Hi all,

                            I received an email asking about the settings checkbox on the Edit Page (caledit.asp) which made me realize that I hadn't explained anywhere what is was for. So here it goes:

                            When you delete an event, the settings for that event don't get deleted by default. This is so that when you add an event with the same name later (or in case you accidentally deleted an event), the same settings return. If you want to delete the settings with the event, then click on the checkbox. However, if you have other events with the same name (which will use the same settings), the settings won't get deleted.

                            Let me know if there's any questions.

                            Cheers
                            Al

                            http://www.sparkman.dns2go.com/
                            HS 4.2.8.0: 2134 Devices 1252 Events
                            Z-Wave 3.0.10.0: 133 Nodes on one Z-Net

                            Comment


                              #74
                              Hi,

                              Just installed the new version and yep all is working well... nice one.

                              However I pulling my hair out in trying to make the cal.asp look the same as my old one, so here is three questions: -

                              1. How do I center the calender in the .asp page. I've tried align="center" in lots of places with no joy.

                              2. How do I change the colours of just Saturdays & Sundays text/titles & boxes?

                              3. In the include footer, the logo powered.jpg is no longer shown, I get Error~!~Web Server Error 404, cannot serve file: C:\Program Files\HomeSeer\html/cal/powered.jpg in the log. I take it this is a path problem, since cal.asp has moved to the /cal folder.

                              Comment


                                #75
                                The missing file C:\Program Files\HomeSeer\html/cal/powered.jpg is actually an issue with the HomeSeer tail.htm file.
                                Look in the html directory for a file called tail.htm and change
                                <pre class="ip-ubbcode-code-pre">
                                img src="powered.jpg"
                                </pre>

                                to:
                                <pre class="ip-ubbcode-code-pre">
                                img src="/powered.jpg"
                                </pre>

                                It's missing the /.

                                Jeff Farmer
                                HomeSeer user since March, 2000

                                Wiring Wall
                                --
                                Jeff Farmer
                                HS 3, HSPhone
                                My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
                                Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

                                Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

                                Comment

                                Working...
                                X