deanishe Posted July 1, 2014 Share Posted July 1, 2014 It shows me Alfred's birthday and Jesus's birthday. Link to comment
rice.shawn Posted July 2, 2014 Share Posted July 2, 2014 It shows me Alfred's birthday and Jesus's birthday. I just really like this response taken out of context. Link to comment
MuppetGate Posted July 2, 2014 Author Share Posted July 2, 2014 I just really like this response taken out of context. Yup, kinda what it does though ... Link to comment
MuppetGate Posted July 2, 2014 Author Share Posted July 2, 2014 It shows me Alfred's birthday and Jesus's birthday. Okay, so that's working okay. Good. Right, I've sent you a PM with a wodge of code in it that might help me track down the problem. Is anyone else seeing the same problem? Link to comment
MuppetGate Posted July 2, 2014 Author Share Posted July 2, 2014 Right, we're up to version 1.2 with clearer instructions regarding the addition of anniversaries. I've also revamped the anniversary function so it doesn't choke if someone's birthday is on the 29th of February, but bear in mind that the next occurrence of this anniversary might be further away than you think. Link to comment
MuppetGate Posted July 3, 2014 Author Share Posted July 3, 2014 And finally, version 1.3! The big change is that the function call go at the end, so instead of this: dcalc wn today You now write this: dcalc today wn I made the change to save keystrokes mainly; you now don't have to tap your way back to the start of the command to change the function, and it's not really a function; it's a bit of formatting that should really happen at the end of the calculation dcalc alfred + 1d wd That will tell you the day of the week one day after Alfred's next anniversary. Link to comment
lidow Posted July 11, 2014 Share Posted July 11, 2014 I found something seems like a bug, but it could be a not doing something right: http://cl.ly/image/1N3F1k183F2m I enter a list item (iva) and when I did dcalc iva-^iva y I expect the years between these two dates, in case of birthday I expect how much years the person will become at his birthday. What I've received is contradictory based on the output format: dcalc iva-^iva y 29 years dcalc iva-^iva ym 29 years, 12 months dcalc iva-^iva ymd 29 years, 12 months, 4 days dcalc iva-^iva long 29 years, 11 months, 29 days, 0 hours, 49 minutes, 41 seconds What I expect is: 39 years, 0 months, 0 days, 0 hours, 0 minutes, 0 seconds Link to comment
MuppetGate Posted July 12, 2014 Author Share Posted July 12, 2014 (edited) Quick question: Did you mean '29 years' in your last example? In any case you shouldn't have 12 months as part of any answer. I think this probably due to a rounding error in the calculation of the formats that are not 'long' (which is more accurate because it is calculated differently). I'll look into it. Edited July 12, 2014 by MuppetGate Link to comment
MuppetGate Posted July 13, 2014 Author Share Posted July 13, 2014 (edited) Right, that was a mostly a bug. Turns out that the decision to supply the current time to anniversaries was not a good one. I've tuned up the formatting stuff (ymwdhMs) but due to uneven months, it's never going to be as accurate as just going for 'long' as the format, which calculates the whole thing in one go. A new version (1.4) is now up on Packal. You should delete Iva's anniversary and create it again. P.S. I've also added start_bst and end_bst for British Summer time. For example: dcalc start_bst Edited July 13, 2014 by MuppetGate Link to comment
MuppetGate Posted July 13, 2014 Author Share Posted July 13, 2014 I might look at the formatting again when I have more time. Thanks. Link to comment
MuppetGate Posted July 14, 2014 Author Share Posted July 14, 2014 Okay, apparently I had more time than I thought. The 'ymwdHMs' should now produce the same (accurate) results as 'long' Version 1.5 is on Packal.org Link to comment
MuppetGate Posted August 26, 2014 Author Share Posted August 26, 2014 Just upgraded into Version 1.6, which is now on Packal.org You can now exclude dates from certain calculations, and the user supplied formatting has been rewritten so that decimals can be shown. Link to comment
MuppetGate Posted September 3, 2014 Author Share Posted September 3, 2014 Hello! Just uploaded Version 1.7 to Packal.org No new functionality; just bug fixes and an update to the latest version of Dean's workflow framework. Link to comment
dma550 Posted October 10, 2014 Share Posted October 10, 2014 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 Link to comment
MuppetGate Posted October 13, 2014 Author Share Posted October 13, 2014 (edited) 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!) Edited October 13, 2014 by MuppetGate Link to comment
MuppetGate Posted January 4, 2015 Author Share Posted January 4, 2015 (edited) 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. Edited January 5, 2015 by MuppetGate Link to comment
MuppetGate Posted January 4, 2015 Author Share Posted January 4, 2015 Version 2.1 The AM/PM indicators are no longer case-sensitive. Link to comment
famaus Posted February 3, 2015 Share Posted February 3, 2015 Hi, Thanks for such a wonderful workflow. I am trying to do below and not sure if it's supported dcalc 10-15-2015 - 60d x weekends From above, I want to get 60 days before date 10-15-2015 excluding weekends. Am I writing it wrong or this isn't supported? Thanks! Link to comment
mmoren10 Posted February 4, 2015 Share Posted February 4, 2015 Hi! I've just discovered your workflow and it's really useful, thank you! I'm a lawyer and I had been looking for a quick way to do a rough calculation of court days to calculate, for example, when a brief is due. I'm trying the following syntax but it's not working, am I doing something wrong? dcalc today-25d exclude weekends Thanks a lot!!! Link to comment
xilopaint Posted February 10, 2015 Share Posted February 10, 2015 Hi! I've just discovered your workflow and it's really useful, thank you! I'm a lawyer and I had been looking for a quick way to do a rough calculation of court days to calculate, for example, when a brief is due. I'm trying the following syntax but it's not working, am I doing something wrong? dcalc today-25d exclude weekends Thanks a lot!!! +1 for this question. I tried "dcalc today+30d x weekends" with no success. The "exclude weekends" feature would be very useful to me. Link to comment
MuppetGate Posted February 12, 2015 Author Share Posted February 12, 2015 Sorry for the delay folks! I'll look into the exclusions questions when I'm back home. Link to comment
MuppetGate Posted February 13, 2015 Author Share Posted February 13, 2015 (edited) 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. Edited February 14, 2015 by MuppetGate Link to comment
MuppetGate Posted February 13, 2015 Author Share Posted February 13, 2015 Yup, the exclusions is not working properly after the last set of changes. I'll take a look at it. Link to comment
MuppetGate Posted February 13, 2015 Author Share Posted February 13, 2015 +1 for this question. I tried "dcalc today+30d x weekends" with no success. The "exclude weekends" feature would be very useful to me. Okay, now I've had a think, I can definitely see why this is useful. I'll put it on the list. Not quite sure when I'll get to it though. xilopaint 1 Link to comment
MuppetGate Posted February 16, 2015 Author Share Posted February 16, 2015 (edited) 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. Edited February 16, 2015 by MuppetGate xilopaint 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now