Document the Story of Your Social Life with 8tory

The different forms of social media are growing every day. It’s hard to imagine a day … more

Make Calling Your Loved Ones Easier and Cheaper this Diwali

Diwali, or Deepawali as some Indians call it, is the pride and joy of Indian … more

Big Android BBQ 5.0 Recap – XDA TV

This fifth annual Big Android BBQ has come and gone. The speakers have spoke, the sponsors have … more

Microsoft to Counter “OK Google” with Bing Torque

When Microsoft is making apps for Android, users should be aware that something … more
Post Reply

Calendar limit

OP fredpel

8th April 2014, 04:49 PM   |  #1  
OP Junior Member
Thanks Meter: 0
 
23 posts
Join Date:Joined: Mar 2011
Hello,
I just started using Zooper so I don't know yet every command and parameter.
On my widget I have 3 lines that display the next 3 calendar events in the format "TUE 8 18:00 EVENT", but "next event" may be coming way far in the future. I'd like to limit events to those of the next 2 weeks (I don't need to know about things that are months away), how can I do that?

Thank you
9th April 2014, 07:28 AM   |  #2  
Junior Member
Thanks Meter: 0
 
8 posts
Join Date:Joined: Apr 2011
Quote:
Originally Posted by fredpel

"next event" may be coming way far in the future. I'd like to limit events to those of the next 2 weeks (I don't need to know about things that are months away), how can I do that?Thank you

I'm rather new to Zooper Widget myself, but I would think that you could make a conditional statement that takes the difference of the date of the event and the current date and if that is < 14, then do the following. Note that I have not tested any of the following, so you would probably have to debug and troubleshoot any issues if some arise.

$#C0SMMdd#-#DMMdd#<=14? #C0TITLE#$
To my understanding, this would say
If (First Calendar event month and Day) - (Current Month and Day) <= 14, then display the name of the first event.

However, there is one flaw with this formula, since it the values would be incorrect the following month (For example the 29th of April would yield the value "0429" and the first of May would be "0501", but the difference is well over 14, but they are within 2 weeks of one another).

Since the difference in months should be the 100s place, you might be able to just do another if statement that says
$[#C0SMMdd#-#DMMdd#>=73] && [#C0SMMdd#-#DMMdd#<=86] [&& #C0SMMdd#-#DMMdd#<-1000]? #C0TITLE#$
I didn't spend a whole lot of time on these numbers, so there may be a few errors. I thought of the worse scenario (Being the last day of February and an event on the next day (0301-0228=73)) and the other scenario being a cap so that you don't get events in the long distant future. The last is for the change of December to January.

As a said, I am rather new to using zooper, so there may be an easier way to do this. If not I hope this helped get you started.
9th April 2014, 11:45 AM   |  #3  
OP Junior Member
Thanks Meter: 0
 
23 posts
Join Date:Joined: Mar 2011
That's definitely a good starting point, I went for
Code:
$#C0yDDD#-#DyDDD#<15?#C0TITLE#$
yDDD gives the date in the format 2014170 (year + day in year with leading zeros, from 001 to 365), so it should be ok in every case

Now I just have to fight with text jumping up and down whether the contain tall letters or not

Thank you very much!

(btw is there a way to stop the configuration window from closing and forgetting what I wrote, if the screen turns off while I'm changing something?)
Last edited by fredpel; 9th April 2014 at 11:47 AM.
10th April 2014, 01:14 AM   |  #4  
Junior Member
Thanks Meter: 0
 
8 posts
Join Date:Joined: Apr 2011
Quote:
Originally Posted by fredpel

(btw is there a way to stop the configuration window from closing and forgetting what I wrote, if the screen turns off while I'm changing something?)

Sadly, I'm not aware of a way to do that. Although, a lot of people use pushbullet and write the code on their computer and then send it to their phone to test.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools
Display Modes