How to automatically offset the today rule according to day in month in pgfgantt?

by rugortal   Last Updated October 09, 2019 17:23 PM

Is there a way to automatically calculate the offset for the today rule in pgfgantt when using time slot unit = month? The offset should be calculated so that, for instance, if 30% of the month has already passed, then today offset = 0.3.

For example, suppose that today is October 9 (which is true). October has 31 days, so that (9-1)/31=0.26 is the fraction of the month that has already passed. In this case, I'd like the following code

\begin{ganttchart}[time slot format = little-endian,
                   time slot unit = month,
                   today=09/10/2019,
                   today offset = auto % what to do here?
                  ]{01/10/2019}{30/09/2022}
    % content here
\end{ganttchart}

to be equivalent to

\begin{ganttchart}[time slot format = little-endian,
                   time slot unit = month,
                   today=09/10/2019,
                   today offset = 0.26
                  ]{01/10/2019}{30/09/2022}
    % content here
\end{ganttchart}

In pseudocode, I'd like to write

today offset = (today.day - 1)/today.month.number_of_days

How can this be done?

Tags : pgfgantt


Related Questions


Updated May 28, 2015 09:09 AM

Updated April 16, 2016 08:09 AM

Updated September 24, 2016 09:09 AM

Updated July 11, 2016 08:09 AM

Updated March 06, 2016 01:10 AM