Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 28
  1. #1
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959

    Thumbs down Free Date Difference Action Plugin

    After reading the post in beta forum, I thought I'd give this a whirl.

    This plugin is called DateDiff and will let you easily add or subtract days, months, or years to/from a date.

    Take it while ya can...

    Unzip the DateDiff.zip and copy it to your Plugins\Actions
    folder then fire up the sample app.

    So for AMS it would be something like this:
    C:\Program Files\AutoPlay Media Studio 5.0 Professional\Plugins\Actions\DateDiff

    Be gentle now, this is my first real go at a true action plugin.
    Attached Files

  2. #2
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Very useful Worm and thanks.

    Seems to work properly right from the get go.

    Intrigued

  3. #3
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Here's an updated version.

    Added:
    DateDiff.GetDayOfWeek
    returns a numeric value representing the day the date passed falls on
    (Sunday = 1 ... Saturday = 7)

    DateDiff.GetDifference
    returns the number of days between two dates.

    Unzip and copy over the existing plugin files.

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Another great addition to WormWare
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  5. #5
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    Quote Originally Posted by Worm
    DateDiff.GetDayOfWeek
    returns a numeric value representing the day the date passed falls on
    (Sunday = 1 ... Saturday = 7)
    Worm, I can’t resist to tease you:

    Sunday isn’t the first day in the week in all counties. In Norway it is the 7th day!

    Thanks for all your gifts. Have a nice day.
    Attached Images

  6. #6
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Well...

    I actually was thinking a little about that. That's why I returned a numeric rather than a string. I was going to return "Monday", "Tuesday", etc.. but thought if I returned a numeric, the user could create a table with their own strings for different languages. The date format being US (MM/DD/YYYY) I'm kind of stuck with as the C++ class I'm using only excepts the date in US format.

    This is a test plugin for me. I'm trying to take some of the knowledge I gleaned from Brett when working on the DataGrid and put it to use. If there is a way to make this better, please say so, and I'll see what I can do.

  7. #7
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    Another update:

    Added:
    DateDiff.FormatSeconds

    takes the number of seconds passed, and formats it into a string HH:MM:SS

  8. #8
    Join Date
    Dec 2003
    Location
    Raleigh, NC
    Posts
    80
    Good going, Worm. What I had in mind was a duplicate of the DateDiff function in VB. The syntax for which is in attached .png.
    Attached Images

  9. #9
    Join Date
    Dec 2003
    Location
    Raleigh, NC
    Posts
    80
    BTW, Worm, since you have modified your date difference plugin a couple of times, do you happen to have full documentation for it that I can keep in one place handy for reference? Thanks. Glad to see someone out there eats code that is breakfast of champions, ditto Tigg. Even Excel spreadsheets have this function, so it will be great to have something similar for Six.

  10. #10
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    The help file should be up to date with the latest additiions.

  11. #11
    Join Date
    Oct 2001
    Location
    Norway
    Posts
    939
    Quote Originally Posted by Worm
    the user could create a table with their own strings for different languages
    YES; no problem! (… and you have an example in your help file). I was joking; tried to.

    BTW I had to do the same “adjustment” when working with a language delivered by a well known vendor (with address Redmond)).

    It’s really nice to have these commands integrated in AMS. LuaCom has some helpful functions for local date formats.

    Code:
    t = os.date('*t')  -- time now [table elements hour, min, wday, year, yday, month, sec, day]
    -- some adjustments needed because the result is displayed in an object with input mask ##/##/####
    if String.Length(t.day) == 1 then 
    	t.day = "0"..t.day;
    end
    if String.Length(t.month) == 1 then 
    	t.month = "0"..t.month;
    end
    Input.SetText("inpLocaleDate", t.day.."."..t.month.."."..t.year);

  12. #12
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    I knew you were jabbing me a little csd214.

    But to be honest when it comes to international dates, you're absolutely right, I'm clueless.

  13. #13
    Join Date
    Dec 2003
    Location
    Raleigh, NC
    Posts
    80
    Yes, thank you, I printed out your help file. Nice. One final question: what will DateDiff.GetDifference do if I attempt to enter a date that's not on the calendar like Feb 29, 1999 or Aug 33, 2005?

  14. #14
    Join Date
    Jul 2002
    Location
    USA
    Posts
    3,959
    In a perfect world it should return -1 for an invalid date format, but I just tried it and it gave me a result.

    I'll look into it when I get a chance.

  15. #15
    Join Date
    Dec 2003
    Location
    Raleigh, NC
    Posts
    80
    10-4. Thanks again. I'll stay tuned in.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Spotlight: CD Audio Action Plugin
    By Desmond in forum AutoPlay Media Studio 5.0
    Replies: 16
    Last Post: 05-15-2006, 07:02 PM
  2. Indigo Rose Plugin Changes
    By Lorne in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 09-27-2004, 04:17 AM
  3. Free Plugin: Media Player Object
    By Ted Sullivan in forum AutoPlay Media Studio 5.0
    Replies: 7
    Last Post: 09-24-2004, 02:54 PM
  4. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM
  5. SUF6.0.0.2 -- installer hangs.
    By jassing in forum Setup Factory 6.0
    Replies: 4
    Last Post: 12-19-2001, 11:28 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts