Results 1 to 12 of 12

Thread: Event Date Limit

  1. #1
    New user americocs's Avatar
    Join Date
    08-31-09.
    Location
    Brasil
    Posts
    9

    Default Event Date Limit

    Hi everybody,

    I'm developing a genealogy site for a client. He needs to add new people to genealogy pool himself, so I thought of using the Events module. Each person would be an event, with start date and end date.

    But I could not create the first person-event, since the date picker seems to have a date limit. This person "start date" is 1882, and I entered the date manually without problems. But when I saved the event, the start date inside the event form reseted to today, and the event list showed the entry under "December 1969".

    I searched a lot and could not find a solution, can anybody help?

    Thanks in advance.

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Event Date Limit

    Seems related to Unix time Epoch (1st jan 1970) http://en.wikipedia.org/wiki/Unix_time

    I don't know how to get around that. You probably have to extend the tl_calendar_events table with a custom start/end dates fields that use a different date format than a unix timestamp.

    Or perhaps you can make the fields signed that way the tstamp can be a negative and represent datetimes before 1970. I don't know if this will work, but you can try. To make the fields signed create a folder called calendar_changes and create a subfolder config. Inside that folder create a file called database.sql and add the following:
    Code:
    CREA TE TAB LE `tl_calendar_events` (
      `startDate` int(10) signed NULL default NULL,
      `endDate` int(10) signed NULL default NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    *remove the spaces for the words create and table. you can't post that on this forum...

    For Contao 3 you'd have to create the subfolder dca instead, copy tl_calendar_events and make it so only the two datefields remain, with their sql entries.

  3. #3
    New user americocs's Avatar
    Join Date
    08-31-09.
    Location
    Brasil
    Posts
    9

    Default Re: Event Date Limit

    Hi Ruud,

    Thanks for the help, I understood the problem and tried to solve it using both your suggestions. It didn't work unsigned, and not even changing datatypes. It's really a shame Unix Time cannot represent anything before 1970, I don't know how I'll proceed. There are 4.000 person-events that were born before 1970, that later will have to be listed by date...

    I'll keep looking.

  4. #4
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Event Date Limit

    Just to be sure; you need it signed. If it is signed negative numbers represent datetimes before 1970.

  5. #5
    New user americocs's Avatar
    Join Date
    08-31-09.
    Location
    Brasil
    Posts
    9

    Default Re: Event Date Limit

    Yes, that's what I meant. I tried it signed, and indeed you can enter negative unix time numbers in the database directly. But my client would have to use the Contao backend to input dates. Even with these fields signed, the Contao backend does not accept dates previous to 1970. I think it would be necessary to tweak the events backend module as well, but I don't know how to do that.

    It's really a shame, the hole project is at a pause because I cannot use dates previous do 1970. Such a simple functionality!

    Thanks again, I'll keep looking for a solution.

  6. #6
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Event Date Limit

    You could place a feature request at github (contao/core). Leo will look at your request and respond accordingly. He might implement it, or perhaps in few words tell you if it is possible and how. If he implements it it will be a small, but nice addition. Though I don't think having an event calendar for events that took place even before TYPOlight was created will be a much wanted feature. But probably the ability is something that, when implemented, will apply to all datetimes and then it becomes more useful.

  7. #7
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Event Date Limit

    Ok, scratch that last post; I've found this: https://github.com/contao/core/issues/3749

    But good news, it talks about an extension (calendarextend) that possibly fixes this.

  8. #8
    New user americocs's Avatar
    Join Date
    08-31-09.
    Location
    Brasil
    Posts
    9

    Default Re: Event Date Limit

    Hi Ruud,

    Thanks for your dedication! I tried a lot of calendar extensions and unfortunately none of them changed the unix time behavior, including calendarextended. I'll keep looking for a workaround, but I'm beginning to think I'll have to change my choice of CMS. That would be a shame because I've been using Typolight/Contao for many years now and I like it very much.

    I don't think it's such a small feature: if you want to list anything historical you just can't. I've been searching the web and I found a lot of people having the same problem with unix time in other CMS (like Drupal, phpNuke, etc.), in projects where they want to list paintings, art objects, historical events, genealogy (like me), even fiction (there is a future limit of year 2038 too).

    If i find anything I'll share it here.

    Thanks again!

  9. #9
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Event Date Limit

    Have you seen that in Contao 2.11.11 members can have date of birth that can be prior to 1970? What field type are those? I think there is something that you can use...

    Honestly I think that switching a cms after years of use for such a small thing is not very wise. (Unless the new CMS is that much better) With that much experience I am sure you can change the behavior and get it to work. If needed you just add two date fields of the same type and code as members have...

  10. #10
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Event Date Limit

    I figured it out. When I set all four of the time and date fields to signed it works on Contao 3. I haven't tested it on Contao 2.11. I haven't done much testing, I tried if I could set a date in the past and if the listing module displays the past date. I'm not sure why Contao won't support this atm when it works like this...

    I'll ask in that one github issue...

  11. #11
    New user americocs's Avatar
    Join Date
    08-31-09.
    Location
    Brasil
    Posts
    9

    Default Re: Event Date Limit

    I think it's because of the way the events module converts unix time to julian time. But I'll certainly make some tests to see if it works!

    You are right, an alternative would be using members module to represent people in the genealogy, in conjunction with the "xtmembers_fieldeditor" extension (allows you to create your own TYPOlight member fields). The only drawback would be the lack of tinyMCA for the client to input rich-text about the member.

    No CMS of the category is better then this one, I just love it. I'll only look for alternatives if I can't find a solution, being this specific project so date dependent. Also, I'm more focused on design and css. I'm usually able to edit some php or js, and I know it's possible to create extensions with the developers tools, but I tried to no avail - I think it's beyond my abilities in a reasonable time.

    Thanks again man, I'll try the time-and-date-both-signed right now!

  12. #12
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Event Date Limit

    When working with Contao it will be of great benefit if you learn php and study to some extend how contao is built up. With limited knowledge you can figure out how most things work. I haven't found an easy manual yet...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •