--NoDr - YGO--

10/23/2005

CALENDAR 066

Classé dans: — @ 10:30 pm

New Release 066

calendar066.tgz

somes bug corrected, lot of simplifications an a workaround for the last one. This workaround serve to pass a bug I can’t understand. The weekday is previous dayfor leap year :-( so workaround correct that
There is not documentation yet.

This release bring two types:

  • DATE

    is millisec based since 01/01/1970
  • CALENDAR

    is seconds based since 01/01/00 BUT NOT FINISHED … please do not use it
  • date

    create a today date tuple
  • parse-date-fr

    date parser exemple
    this word should create a vector { timelag hour min sec day month year } then call vector>date
    (eg: “25/07/2005 16:12:18″ parse-date-fr )
  • format

    date formater
    Use a format vector using some Keyword ( %day=day-name %month=month-name %Y=year %M=month %D=day %H=hour %M=min %S=second)
    eg: { %day ” ” %D “/” %M “/” %Y ” ” %h “:” %m “:” %s } format .
  • print-month

    year month printer
    eg: 2004 1 print-month
    Jeudi 01/01/2004 00:00:00
    Vendredi 02/01/2004 00:00:00
    Samedi 03/01/2004 00:00:00
    etc…


Some exemples

date dup { %D “/” %M “/” %Y ” ” %h “:” %m “:” %s } format parse-date-fr { %day ” ” %D “/” %M “/” %Y ” ” %h “:” %m “:” %s } format . { %day ” ” %D “/” %M “/” %Y ” ” %h “:” %m “:” %s } format .
“25/07/2005 16:12:18″ parse-calendar-fr { %day ” ” %D “/” %M “/” %Y ” ” %h “:” %m “:” %s } format .

10/3/2005

Calendar Updates

Classé dans: — @ 8:00 pm

Rel: 052

dates052.tgz

Very few modifications - code cleaning


Calendar become Dates Rel: 051

dates051.tgz

Start of some code cleaning and a major change for name

CALENDAR become DATES

WHY :
Main differences with dates and calendar are:

  • date:

    is millisec based
    limited to timespace 01/01/1970 > today
    limited in computations (days+/hour+/minutes+/seconds+)
    use GMT timelag but no timezone
  • calendar:

    (this will be built in far far futur)
    seconds based
    not limited in timespace (since 01/01/0000 to defined)
    Gregorian or other possible
    permit direct setting for day/month/year
    adding year/month/day/hour/minutes/seconds according timezone
    use timezone (winter/summer time according timezone)


Rel: 05

calendar05.tgz

Many changes according Slava suggestions that simplify the code by a lot
WARNING this release doesn’t work with date < 01/01/1970
this is a major bug. Next release should resolve this issue (I hope).
There is still some parts to simplify and finish.
This code si NOT WELL TESTED and it may containt bugs !!!

  • New generic formater

    { %D “/” %M “/” %Y ” ” %h “:” %m “:” %s } datefmt .
    Give “25/07/2005 16:12:18″

  • Calendar functions


    localedate

    give locate value of milliseconds according timezone

    fulldays

    number of days since 1/1/1970

    year

    Year number

    month

    Month number

    monthname

    Name of the month according locales

    day

    Day number

    dayname

    Name of the day according locales

    hour


    minutes


    seconds


    timezone

    Value of timezone GMT based

    hour+

    Add N hours to calendar

    min+

    Add N min to calendar

    sec+

    Add N sec to calendar

    day+

    Add N days to calendar

    Parser

    Warning parsing is limited to date > 01/01/1970 (anterior date give negative millis:-( probably I should change the internal representation for millisec or hack for negative number ).
    calendar-builder take a list in the form [ gmt h mn sec jj mm yyyy ] and build the date. The string date can be parsed like on the exemple parse-fmt-fr in locales.factor.

    - Now all the fiels are computed on demand. Hope this is fast enougth.
    - Now I have set by default
    2 “timezone” set ! default GMT + 2

    “fr” “locales” set ! defaut locales france

calendar05.tgz


Rel: 04

  • few modifications and changes for Factor 078/079

calendar04.tgz

Rel: 03

  • Add simple date parser
  • not sure it is bug free

calendar03.zip

not sure it is bug free

calendar03.zip
Exemple of use
“25/7/2005 16:12:18″ parse-fmt-fr .s
<< calendar [ ] 1122307938000 12989 58338 2005 206 7 25 16 12 18 "fr" 0 "fr" >>
calendar>string .
“25/7/2005 16:12″

Of course you need to write your own parser using parse-fmt-fr as exemple
Now I am stopping for few time on calendar , trying another things on Factor

Rel: 02

Following slava comments, some simplifications

  • remove stupid t f ?
  • remove unusefull GENERIC
  • still TODO replace contain? by member? and string date parser

Still the same request on TUPLE

How to remove some mutator field: >> :private thing ?

calendar0.2.zip
Exemple of use
new-calendar
dup calendar>string .
“20/7/2005 7:47″
dup “fr-full” swap set-calendar-locale
dup calendar>string .
“Mercredi 20/7/2005 7:47:49 GMT:0″
dup 2 set-timezone
dup calendar>string .
“20/7/2005 9:47″

warning still probably buggy

Réalisé avec WordPress  visitors