stepWeek

Integrating and modifying Proof's amazing mini-calendar.
Proof Group
Proof Group
Posts: 6
Joined: Tue Jun 24, 2008 4:16 am
PostPosted: Mon Mar 16, 2009 2:59 pm
Okay, I don't know why we didn't think to add a stepweek action but here's how you'd hack the script to do this. It's pretty simple and safe but please make sure you backup your original NinjaCal file :).

1) Edit the NinjaCal ( action ; params ) script.
2) Find the section for stepMonth
3) duplicate the entire section and make the following changes

#---------------------
#stepWeek ( n )
#---------------------
If [ $action = "stepWeek" ]
Set Variable [ $n; Value:GetValue ( Get(ScriptParameter) ; 2 ) ]
Set Variable [ $lasterror; Value:If ( GetAsBoolean ( $n ) ; 0 ; 1201 ) ]
If [ $lasterror = 0 ]
Set Variable [ $$__NinjaCalBaseDate; Value:Date ( Month ($$__NinjaCalBaseDate ) ; Day($$__NinjaCalBaseDate ) +
($n*7) ; Year ($$__NinjaCalBaseDate )) ]
End If
Refresh Window
[ Flush cached join results ]
Exit Script [ Result: $lasterror ]
End If


that's it. you should now have a 'stepweek' action. Make sure you pass the action and and number of weeks to step in your script calls; e,g. perform script NinjaCal ( action; params ) with params: "stepWeek¶1"[/img]
Ernest Koe
The Proof Group LLC

Return to NinjaCal

Who is online

Users browsing this forum: No registered users and 1 guest

cron
(855) SEEDCODE
support@seedcode.com
Follow us: