Jump to content

MuppetGate

Member
  • Posts

    132
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by MuppetGate

  1. Flying visit! Sorry!

     

     

    Hi,

     

    I am not sure if I am doing this right or if this is a bug.

     

     

     

     

    It's a bug. The fix is now on Packal

     

     

    Could you add "mudda" as a synonym for "mom"? Mother's Day in Germany is the same as in the US.

     

     

    I most certainly can!

     

    dcalc mutter 

     

    will give Mother's Day in Germany. I also noticed that I've calculated Mother's Day for US (and so Germany) incorrectly: it is the second Sunday in May, not the third, as I previously thought.

  2. Yet another update!

     

    First off, I've added a few abbreviations that should make it a lot easier to get at the more common functions.

     

    dcalc *

    for today's date.

     

    dcalc <

    for yesterday

     

    dcalc >

    for tomorrow

     

    dcalc &

    for the current time

     

    dcalc #

    for the time and date

     

    And of course you can combine these with date and timespan functions, but they may be a little hard to read.

     

    dcalc > + 1d

     

    is the day after tomorrow.

     

    I've also added a few other functions.

     

    dcalc pancake day (guess what that is)

     

    dcalc lent (the start of Lent)

     

    dcalc mlk (Martin Luther King day)

  3. Thank you for the quick and nice update!

     

    Would you consider to make dcalc today +30d and dcalc +30d give the same result?

     

    Mmmm. That would involve a rather specialist case for the parser which I try to avoid.

     

    What I might do is abbreviations for the more common functions, so you can do something like this:

     

    dcalc *

     

    for the current date, and then you can do:

     

    dcalc *+60d

     

    to add 60 days to the current date.

  4. G'morning folks.

     

    I've updated the workflow (again!) to tidy up a bit of the code and add a couple  of new small functions.

     

    First up, the requested expansion to the exclude functionality. As well as working with timespans, you can now use it on functions that return absolute dates.

     

    For example:

     

    dcalc today + 60d x weekends

     

    will give you a date 60 days from now that has been adjusted to discount any weekends that occur in the timespan.

     

    The second change is the expansion to the week_number function.

     

    You can already do this:

     

    dcalc today wn

     

    to find the current week. Great stuff, but then I ran into an odd one at college the other day. The lecturer said, "Final pieces need to be submitted by week 19."

    And someone else said, "What date is that?"

    And of course, no one knew.

     

    So

     

    dcalc wn 7

     

    will give the date for week 7 of the current year. It will use the current day of the week you're sitting on as the baseline. So if I enter the command on Monday, it will give me the date of Monday week 7. That's not especially useful, so it's probably better to supply the day of week as well:

     

    dcalc wn 7 sun

     

    So that will give you the date on Sunday week 7

     

    And of course, you might want to pick out a different year:

     

    dcalc wn 2016 7 sun

     

    will give the date on Sunday in the 7th week of 2016 (which is  the 21st of February apparently).

     

    That's it for now. The new version can be found here.

  5. Riiiiggghhht.

     

    Interestingly enough, you're all trying to do the same thing.

     

    There's actually two types of calculation: one returns  a time span, the other returns a date.

     

    The 'exclude' only works on a timespan.

     

    If you enter today + 30d, that will give you a date.

     

    But today - 13.03.2015 will give you a timespan (1 month, 2 weeks, 4 days and a rogue second) which can be used with exclusions.

     

    today - 13.03.2015 exclude weekends

     

    The exclude function only works on functions returning timespans, not dates.

     

    Unfortunately, some stuff I've done with formatting has made this far less useful, so I'm going to have to make some changes to it.

     

    Sorry about that!

     

    But yes, the exclusions only work on timespans, not calculations that deliver a final date. I'll have a think about that one.

  6. Hello, and happy new year!

     

    Okay, I've been fiddling about with the date calculator to make it a little bit more versatile.

     

    First up, it now supports the 12-hour clock for entering and formatting times. I'm not a big fan of this format because it requires more typing (it has to be in this format: xx:xxAM/PM) which I think is harder to work with than the 24 hour clock. The AM/PM indicators have to be in upper case, but I'll fix that this afternoon.

     

    A Python wizard called Mike Taylor has a framework that can translate natural language into a date. I've dropped the framework in as a bit of an experiment, so if you surround the date expression in double quotes, the workflow will have a go at translating it for you.

     

    dcalc "day after tomorrow"

     

    dcalc "next tuesday"

     

    dcalc "3 hours from now"

     

    It really is a lot of fun!

     

    Finally, I've added something to celebrate finishing the first draft of my book:

     

    dcalc passover

     

    will work out the date of the next passover.

  7. Hi, this a great tool, thank you.  Any thoughts to expanding the time calcs?  I am constantly needing to do things like this:  3:15pm-6:45pm = 3.5 hrs

     

    Thanks

     

    Hello there. Thanks very much; I'm glad you find it useful. 

     

    Right, time calculations. 

     

    dcalc 15:15 - 18:45  

     

    gives you 0 days by the looks of it,  which looks like a bug somewhere.

     

    But all is not lost!

     

    If you try:

     

    dcalc 15:15 - 18:45 h

     

    That will give you:

     

    3.500 hours

     

    The 'h' is sort of like a formatting code and means 'give me the result in hours'

     

    dcalc 15:15 - 18:45 hM

     

    Gives the result in hours and minutes:

     

    3 hours, 30.000 minutes

     

    and

     

    dcalc 15:15 - 18:45 hMs

     

    gives

     

    3 hours, 30 minutes, 0.000 seconds

     

    The workflow only understands the 24-hour clock, but I might make the 12-hour clock an option when I have a bit more time. (I'm trying to write a book at the moment!)

  8. Important Message

     

    There is a pretty serious bug in all versions of the library previous to 1.8.6 (the current version). If a user has non-ASCII characters anywhere in the path to where his/her workflows are installed, the library will fail.

     

    If you've released a workflow based on Alfred-Workflow, please update it to use at least version 1.8.6 of the library.

     

    My sincere apologies to the users and developers this has affected.

     

    Thanks for the heads up. I'll update as soon as poss.

  9. Well, if you install the Packal updater workflow, then you get access to updating through Alfred, but not through the Alfred Preferences GUI, but, in a way, you get more direct access to update via the Alfred Bar itself, and, if you need, you have the GUI. And if we consider Packal as a standard way, then, well, I'd love that!

     

    While Workflows aren't signed, Packal will codesign each workflow and check those before updating anything through the Packal Updater Workflow. Since the original poster to Packal is the only one who can update it, then there is a level of security there.

     

    I like to think that I saved Andrew from having to do that work so that he could focus on more cool things.

     

    Packal ain't perfect, but I'm still trying to make it better, albeit slowly.

     

    Yes, I think I wrote that before the Packal Updater went live.

     

    It is, indeed, the dog's danglies.

     

    :-)

  10. Ah interesting... might work, will give it a shot.  Is it required to use an additional scripting language like AppleScript to do simple conditionals in Alfred?  I had thought that it would have that capability built in given that it's supposed to be an automation tool (unless I misunderstand its intended applications).

     

    Thanks!

     

    I did put in a feature request for some sort of conditional workflow module a couple of years ago. Hope it comes along some day.

×
×
  • Create New...