Jump to content

MuppetGate

Member
  • Posts

    132
  • Joined

  • Last visited

  • Days Won

    4

Posts posted by MuppetGate

  1.  

    Okay, I’ve scored a bit of time to revisit the date app and fix a few bugs. Not everything has been looked at because I’ve got to head off again for a while, but what I have done is:


    –    Upgraded the workflow library
    –    Fixed a few of the scripts that referred to Alfred 2 instead of Alfred 3 (I guess this means Alfred 2 is no longer supported).
    –    A bit of a general code tidy up


    The big piece of work though, is the restoration of the exclude functionality, which should work properly, but with limitations. To prevent it blowing things up if the search combination doesn’t produce a valid match, I’ve limited the workflow to about 300 attempts to look for a match. After that, I’ll throw an error.


    So how does it work? Here’s a quick example.


    Say you’re a busy project bod and you have a piece of work that’s going to take three weeks. So you enter the data expression:


    dcalc today + 3w


    And that gives you a date three weeks into the future. But hang on a sec: no one works weekends, so how long will it take if there are no weekends included:


    dcalc today + 3w exclude weekends


    So now the date will be further into the future because weekends are not counted as part of the project. (Another way to look at it is if people worked weekends then the project could be brought in at an earlier date).


    You can exclude individual days:


    dcalc today + 3w x weekends 28.10.2018 


    This will exclude all weekends and also the 28th of October. Note that you can just use x or ex instead of exclude.
    We can exclude other days:


    dcalc today + 3w x Tuesdays Wednesdays Fridays


    We can also do ranges:


    dcalc today + 3w exclude Tuesdays 30.10.2018 to 05.11.2018 02.12.2018


    This beast will exclude Tuesdays, all days between the 30.10.2018 and 05.11.2018, and it will also exclude 02.12.2018
    We can also do:


    dcalc today + 3w exclude all except tuesdays


    Error checking is minimal, but this kind of stuff won’t work:


    dcalc today + 3w ex all except wednesdays wednesdays
    dcalc today + 3w x weekends weekdays

     

    Because every day has been excluded.

     

    The update can be found in the usual place:

     

    http://www.packal.org/workflow/date-calculator

     

    The usual disclaimers apply, so don't use this to schedule brain surgery.  Use a calendar.

     

  2. On 06/04/2017 at 6:48 AM, Tomasz Banas said:

    Is there a way just to type "dcalc mm/dd/yy" and see how many days it is since that day until today without typing "dcalc mm/dd/yy - today"?

     

     

     

    Unfortunately, no. :unsure:

     

    But I have put in some abbreviations for some of the common functions.

     

    *  today

     

    &  the current time

     

    #  now

     

    <  yesterday

     

    > tomorrow

     

    If you want today's date, then just type:

     

    dcalc *

     

    So the slightly quicker way to do your calculation would be:

     

    dcalc mm/dd/yy-*

     

    Hope that helps.

     

     

    Mmm, looking at your question again, it looks like the answer is yes. :D

     

     

  3. On 22/11/2016 at 2:49 AM, roccitman said:

    Hey there.

     

    Is there a quick way to change the date calc answer so it spits out the number of days? So I often need to find out how many days are between two dates. Example 2017-02-25 - 2017-01-01

     

     

     

    Yup, try the same thing but add the 'd' at the end to set the result format.

     

    2017-02-25 - 2017-01-01 d

  4. Another update. Unfortunately, it's just bug fixes and the removal of the exclude function as it has proved to be too unreliable to be trusted.

     

    xilopaint highlighted a problem whereby I wasn't accounting for excluded dates that fell inside the new range once the exclusion was calculated. For example, if I was excluding weekends and which pushed out the date to another weekend, then I wasn't accounting for the new weekend and pushing the date out even further. Having fixed the problem, I realised that it was now possible to enter an expression that the calculator would be unable to fill because date would keep getting pushed further back. Rather than have something that dangerous in the workflow, I decided to pull the functionality all together … sorry!

     

    So this latest version of the workflow is pretty much the same, aside from bug fixes and the removal of the exclusions.

     

    http://www.packal.org/workflow/date-calculator

  5. qTHk2Fq.png

     

    input = dcalc 06/07/2016 +20d x weekends

    date format = dd/mm/yyyy

     

    The correct output should be 03/08/2016.

     

     

     

    Important Note! Do not skip over and surf something else!

     

    xilopaint has highlighted a problem with the exclude calculation, so steer clear of it.

     

    I'm looking into the tidiest way to fix it, or possibly pulling it altogether because I've never been quite comfortable with excluding something that causes the end result to get further away.

     

     

    It's always been an odd one that.

     

    Anyway, don't use it; it'll make you late for stuff.

  6. Hello,

     

    Thanks for this workflow, this is an amazing piece of work.

     

    Now that the exclude weekends behaviour has been changed, how can I know how many working days are left until a specific date?

     

     

    This should work the same way it worked before:

     

    dcalc today - christmas exclude weekends 

     

    should give you how much time you have until Christmas day excluding weekends.

  7. Okay, this doesn't look like it's is going to show up any time soon, so I took Deanishe's advice and looked for an alternative clipboard manager. I've tried a couple of them over the last couple of months, and finally settled on this one:

     

    http://copiedapp.com

     

    It looks good, balances functionality and weight pretty well and isn't too expensive.

     

    It supports rich text and images and it can also share clipboards between a Mac, an iPad and an iPhone on the same iCloud account. It's really useful to be able to take a picture on the iPhone and have it instantly available on the Mac without any faff.

     

    Now that I've been running this for a while, I agree with Deanishe: some things are best left to an application crafted to do those things, which is why I turned off Alfred's clipboard function and just run with Copied.

     

    I'm not tied in any way to Copied's developer; I just think it's worth a look, especially if you want to share clipboards across devices.

  8. Hello,

     

     

    I used sometimes your workflow: very useful!

     

    I don't know why, but today it doesn't work... "invalid command".

     

    I don't remember to change something.

     

     

    Not sure why this happening. I'm not seeing it here.

     

    What are you typing into Alfred exactly? I've entered 

     

    dcalc today

     

    and it seems to work fine. 

  9. Merry Christmas folks!

     

    And a new version of the date calculator.

     

    The only noticeable change is that I've added a help page, accessed from a website. Not ideal, and I'll roll it into the workflow once I've finished it completely.

     

    Accessed by entering 

     

    dcalchelp

     

    on the Alfred command line. The new version can be found in the usual place (Packal).

     

    Though, I'm not sure it'll see much use, the exclusion function now works with date addition calculations. It's a little bit weird, but if you do enter something like this:

     

    dcalc today + 60d

     

    then you'll get the date sixty days from now. But if you do this:

     

    dcalc today + 60d exclude weekends

     

    will push out the date further to take account of weekends. The idea is that if you want to know how long you have to complete a project, then you might want the +60d to take into account the fact that you don't work on weekends. 

     

    It's a bit of an experiment!

     

    http://www.packal.or...date-calculator

  10. Theoretically, it should work, but even after I "allow" 10.11 to work on my computer... it doesn't actually work. I've narrowed the possible problems down a little bit, but I haven't isolated the problem yet.

     

    So, as a larger update, I've rewritten Packal, and it's undergoing a testing phase right now. (There are still a few more kinks to work out). The Packal Updater has been completely redone in order to work with the new backend. The code for both are much more solid this time around, and the updater is now a more general update / search / install for workflows as well as themes.

     

    I have yet to re-implement the GUI for the updater for the new version (although there is a very handy cli utility that's included). Generally, how many of you prefer to use the GUI? I can re-implement it, but I don't want to do so if it isn't widely used.

     

    Let me know.

    I used it because the Packal updater usually didn't find workflows that needed updating. If the next version is more reliable then I can live without the GUI.

  11. Hey Brilliant workflow.

    I am very excited about decal today + 10d x weekends, but it doesn't do what I expect.  I want to know when I can expect something to be done that takes 10 working days to do.   Excluding weekends in a today + days command seems to reduce the time instead of extend it.  Is that a bug?  Or am I thinking about it wrong?

     

    Mmmm. Yes, I see what you're saying.

     

    This function was only supposed to work with date substractions:

     

    dcalc today - 301.10.2015 x weekends d

     

    But I can see that I used the same maths for date additions (as you are trying to do), which probably isn't what is needed.  I'll have a think about it. At the moment I'm working on the help page, so if I do it then it'll probably be the next thing on the list.

  12. Just want to say thanks for this awesome workflow!

     

    I was trying to edit the anniversaries list and couldn't get it to work. I did some digging and found a few bugs in code with passing the date format in set_anniversary.py (calls to convert_date_time()) and macros_parser.py (call to super constructor). The methods do not accept the date format parameter as it is retrieved from the settings parameter. For example (line 21 in set_anniversary.py):

    date_time, output_format = convert_date_time(command.dateTime, date_mapping['date-format'], wf.settings)
    

    date_mapping['date-format'] should be removed. Just thought I'd let you know. Thanks again!

     

    Thanks for pointing this one out.

     

    Seems I forgot to check in some changes. I'll fix it over the weekend.

×
×
  • Create New...