Start of a date handling library
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Start of a date handling library
Hi Malte!
A week can cover the end of one month and the start of next and even the end of a year and start of the next.
So I think it would good to have the results of a weekDates function as a list with one date per line and each date
complete with Year, Month and Day, comma separated. Year four digit, Month one or two digit and Day one or two digit.
All the best,
Mats
A week can cover the end of one month and the start of next and even the end of a year and start of the next.
So I think it would good to have the results of a weekDates function as a list with one date per line and each date
complete with Year, Month and Day, comma separated. Year four digit, Month one or two digit and Day one or two digit.
All the best,
Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Re: Start of a date handling library
For the complete year? Or For a month? Or? Does it need input parameters?
Cheers,
Malte
Cheers,
Malte
Re: Start of a date handling library
Malte!
Sorry, seems I did not think it through! I'll make another try!
My thought initially was that you give a date as parameters in the format:
libDate_weekDates (tYear,tMonth,tDay)
I will now, almost magically change my mind.
What I want is this:
function libDate_weekDates pYear,pWeekNumber
We can already easily get the week number with libDate_CalendarWeekISO (tYear,tMonth,tDay).
So Year and week number as parameters should be fine and cover the needs.
I still would like the result as a list with one date per line and each date complete with Year, Month
and Day, comma separated. Year four digit, Month one or two digit and Day one or two digit
All the best
Mats
Sorry, seems I did not think it through! I'll make another try!
My thought initially was that you give a date as parameters in the format:
libDate_weekDates (tYear,tMonth,tDay)
I will now, almost magically change my mind.
What I want is this:
function libDate_weekDates pYear,pWeekNumber
We can already easily get the week number with libDate_CalendarWeekISO (tYear,tMonth,tDay).
So Year and week number as parameters should be fine and cover the needs.
I still would like the result as a list with one date per line and each date complete with Year, Month
and Day, comma separated. Year four digit, Month one or two digit and Day one or two digit
All the best
Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Re: Start of a date handling library
Implemented. This brings some other low hanging fruits, which I will be adding before the next release.
Cheers,
Malte
Cheers,
Malte
Re: Start of a date handling library
Malte!
This is really really nice! A very elegant function! Can't wait for the rest of the fruit party!
I will build a calendar widget now using rGrid and integrate it into rIDE.
Thanks again for your fine work!
Mats
This is really really nice! A very elegant function! Can't wait for the rest of the fruit party!
I will build a calendar widget now using rGrid and integrate it into rIDE.
Thanks again for your fine work!
Mats
http:www.tapirsoft.on-rev.com
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Open Source LiveCode Plugins - rIDE, rGrid, rTree
LiveCode projects
Re: Start of a date handling library
Your welcome. I just updated the library in the first post of this thread.
Best,
Malte
Best,
Malte
Re: Start of a date handling library
I got a strange report that libDate would error out for the dateRange of the ISO Week (libDate_DaysOfCalendarWeekIso) does anybody else see this?
Best,
Malte
Best,
Malte
-
- VIP Livecode Opensource Backer
- Posts: 76
- Joined: Tue Mar 05, 2013 7:00 pm
- Location: Berlin
- Contact:
Re: Start of a date handling library
Hello Malte,
thank you very much for your great work on the date handling lib.
Do you have any idea how to get the the number of workingdays between 2 dates?
Ok, for beeing perfect it would be necessary to use an extra lookuptable for free extra days and holidyas, but it would be very helpful only to exclude saturday and sunday on demand in the calculation of libDate_DaysBetween.
Cheers Michael
thank you very much for your great work on the date handling lib.
Do you have any idea how to get the the number of workingdays between 2 dates?
Ok, for beeing perfect it would be necessary to use an extra lookuptable for free extra days and holidyas, but it would be very helpful only to exclude saturday and sunday on demand in the calculation of libDate_DaysBetween.
Cheers Michael
Re: Start of a date handling library
Hi Michael,
sorry I did not see your reply earlier. Been a tad bit busy over here.
The problem with this is that hollidays differ very much between different locations. If I look at germany alone, we have 16 different holliday calendars for the different regions. So what would need to be implemented would be a lookup table for hollidays in your region. Doable, but also a moving target. It is relatively simple to account for most christian hollidays (I got that in place in a project and might move that into the lib). But for other hollidays I can not see a way around some sort of lookup table. Sat and Sun would be trivial though.
Best,
Malte
sorry I did not see your reply earlier. Been a tad bit busy over here.
The problem with this is that hollidays differ very much between different locations. If I look at germany alone, we have 16 different holliday calendars for the different regions. So what would need to be implemented would be a lookup table for hollidays in your region. Doable, but also a moving target. It is relatively simple to account for most christian hollidays (I got that in place in a project and might move that into the lib). But for other hollidays I can not see a way around some sort of lookup table. Sat and Sun would be trivial though.
Best,
Malte
Re: Start of a date handling library
I have put quite some work into the lib. The zipped stack is attached to the first post of this thread.
There is still quite a bit to do, however it is worth downloading the update:
Handler and Function names have been cleaned up. Also a parser has been added to finally get rid of the convert command as good as possible. I need your help now! I would like to add parsing for as many different languages I can get.
If you are using operating systems set to languages other than english, swedish or german, could you please be so kind to post:
the system dateFormat
the long system dateFormat
the abbrev system dateFormat
the system monthNames
the abbrev system monthNames
the system weekDayNames
the abbrev system weekDayNames
on your machines, along with the language you are using on your system and if possible the ISO code for that language? That would be a great help!
Be well,
Malte
There is still quite a bit to do, however it is worth downloading the update:
Handler and Function names have been cleaned up. Also a parser has been added to finally get rid of the convert command as good as possible. I need your help now! I would like to add parsing for as many different languages I can get.
If you are using operating systems set to languages other than english, swedish or german, could you please be so kind to post:
the system dateFormat
the long system dateFormat
the abbrev system dateFormat
the system monthNames
the abbrev system monthNames
the system weekDayNames
the abbrev system weekDayNames
on your machines, along with the language you are using on your system and if possible the ISO code for that language? That would be a great help!
Be well,
Malte
Re: Start of a date handling library
From french OSX 10.9 system :malte wrote:If you are using operating systems set to languages other than english, swedish or german, could you please be so kind to post:
the system dateFormat : %d/%m/%Y
the long system dateFormat : %A %#d %B %Y
the abbrev system dateFormat : %a %#d %b %Y
the system monthNames :
janvier
février
mars
avril
mai
juin
juillet
août
septembre
octobre
novembre
décembre
the abbrev system monthNames :
janv.
févr.
mars
avr.
mai
juin
juil.
août
sept.
oct.
nov.
déc.
the system weekDayNames :
dimanche
lundi
mardi
mercredi
jeudi
vendredi
samedi
the abbrev system weekDayNames :
dim.
lun.
mar.
mer.
jeu.
ven.
sam.
on your machines, along with the language you are using on your system and if possible the ISO code for that language? That would be a great help!
iso code (639-1, 639-2, 639-3) : fr, fre/fra,fra
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Start of a date handling library
..........
Last edited by [-hh] on Wed Aug 13, 2014 4:03 pm, edited 1 time in total.
shiftLock happens
Re: Start of a date handling library
Hi Herrmann,
vielen Dank!
%#y seems to be a new placeholder in the engine then. I wonder what for though. It used to be %y for a two digit year and %Y for a four digit year. The question is what LC 7 now means with %#y...
What do you get for: put the short english year?
All the best,
Malte
vielen Dank!
%#y seems to be a new placeholder in the engine then. I wonder what for though. It used to be %y for a two digit year and %Y for a four digit year. The question is what LC 7 now means with %#y...
What do you get for: put the short english year?
All the best,
Malte
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: Start of a date handling library
..........
Last edited by [-hh] on Wed Aug 13, 2014 4:03 pm, edited 1 time in total.
shiftLock happens