← Back to team overview

dhis2-devs team mailing list archive

Re: flexible start-of-week?

 

Hi Johan

Weeks are really something of a nightmare.  And the fact they don't
add up to a month is also a pain.  Do they really use strict 4 week
cycles in Caribean or do they at some point adjust to a month?  4 week
cycles makes some sense but I am not sure how that might be
implemented in aggregation.

There is also the different financial years.  And just saw Greg's post
re Islamic calendar ....

Computers in general seem to struggle to manage with the many
different ways us human beings choose to mark time.  Either moon
gazers or sun watchers.  I think the ideal was that we would just set
the locale and the operating system would take care of the rest.
Sadly not the case.  seems we are more complicated than that.  I think
the Islamic calendar is particularly complex.  Mind you a Muslim might
argue that it is really quite simple .. just keep your eye on the
moon.  It is the Gregorian calendar which is complex and unnatural.

One could look at solving these problems in the most general way - in
a sense we do have the kernel of that already as we persist periods
with start and end dates so in theory (and practice) we can persist
any possible duration (strictly speaking, anything with a start and
end date is a duration rather than a period).  But which durations are
allowed is governed by java code rather than configuration.  That is
an attempt to maintain sanity but there is a point when it maybe
starts to work against us.

other thoughts:
Most users (for better or for worse) want to eventually look at their
data in Excel.  One consideration would be to try to support what
excel supports.

Mydatamart makes use of iso8601 period strings rather than the more
generic start/end date.  A free-for-all of custom period types would
have a knock on effect.

There are more local peculiarities to capture about weeks than just
the day they start on.  Which is the first week of the year is one.
And I believe some countries even do a shorter or longer  week at the
end/beginning of the year..

Clearly quite a bit of thought required here and we certainly haven't
solved all of this satisfactorily yet.  Make a blueprint.  Perhaps one
day (not right now) we can nominate a week to dedicate to thrashing
out calendar issues.  That would be week 42.

Bob

On 27 April 2012 08:40, Johan Sæbø <johansa@xxxxxxxxxx> wrote:
> Jason,
>
> yes, I think it is a blueprint to define periods through the user interface.
> In this particular case, we work around it by using standard ISO-weeks to
> approximate the caribbean sunday-saturday 4-weekly reporting.
>
> But the monday-sunday is not so standard as it appears. A lot of middle
> eastern countries have saturday as first day of the week, and a lot of
> countries in the Americas have sunday (like the caribbean). Then there are
> also other rules for numbering weeks. Luckily, months and years are a bit
> more standardized.
>
> Has anyone else encountered this requirement?
> Johan
>
>
> On 27.04.2012 06:35, Jason Pickering wrote:
>>
>> Hi Johan,
>>
>> I think this would be something the developers would need to do,
>> although it is not too difficult to implement. Source is available
>> here
>>
>> \dhis-2\dhis-api\src\main\java\org\hisp\dhis\period
>>
>> And by the four weeks period, you mean something which starts on a
>> Sunday, not on a Monday?
>>
>> It sounds like this is really a bigger blueprint, namely the ability
>> to dynamically define period types somehow through the user interface.
>>
>> Regards,
>> Jason
>>
>>
>>
>> On Thu, Apr 26, 2012 at 3:30 PM, Johan Sæbø<johansa@xxxxxxxxxx>  wrote:
>>>
>>> And how would I go about to create these custom periods? While at it, I
>>> would actually like to create four-week periods, starting with a sunday.
>>> Right now four-weekly reporting can be done by selecting week 1, 5, 9 etc
>>> when using weekly intervals, but it would be better with four-weeks
>>> "1-4",
>>> "5-8" etc.
>>>
>>> Regards,
>>> Johan
>>>
>>>
>>> On 16.04.2012 17:05, Jason Pickering wrote:
>>>>
>>>>
>>>> AFAIK, in DHIS2, weeks are ISO weeks, meaning they start on the first
>>>> Monday of the year which contains a Thursday.  I am sure Bob can
>>>> provide much more info on the ISO8601 standard.
>>>> It would seem you would need a custom period in this case, similar to
>>>> what has been done with the Fiscal  years.
>>>>
>>>> Regards,
>>>> Jason
>>>>
>>>>
>>>>
>>>> On Mon, Apr 16, 2012 at 3:40 PM, Johan Sæbø<johansa@xxxxxxxxxx>
>>>>  wrote:
>>>>>
>>>>>
>>>>> Hello,
>>>>>
>>>>> I can't find any place to indicate which day a week starts, is this
>>>>> possible
>>>>> somewhere? For reporting purposes, Sunday is the first day of the week
>>>>> in
>>>>> the caribbean.
>>>>>
>>>>> Johan
>>>>>
>>>>> _______________________________________________
>>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>>> More help   : https://help.launchpad.net/ListHelp
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Mailing list: https://launchpad.net/~dhis2-devs
>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>> More help   : https://help.launchpad.net/ListHelp
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp


References