Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorsuthern
     

    The calendar plugin is a nice start. Kudos to whoever programmed it. I think a great addition would be some sort of date_helper in the form of a clickable calendar.

    Perhaps something like the purdue calendar? oooo, check out this little statement at the bottom: "This code is for use by Purdue University staff, students, and departments. It is not licensed for public download." What a narrow view! Oh well, Javascript calendars are all over the internet.

    Here's another good one.

    Has anyone already started coding one?

    • CommentAuthorsuthern
     

    For those of you who are interested, here is what I did.

    I went to the 2nd link mentioned above, and copied all three source .js files into one CalendarPopup.js file. I put the new CalendarPopup.js file inside public/javascripts folder.
    I added this line to the LAYOUT header for the specific view:
    <?php echo $asset_tag_helper->javascript_include_tag('CalendarPopup.js') ?> I added this bit of javascript to the top of my {viewName}.tpl file:

    <script type="text/javascript">
    var calx = new CalendarPopup("caldiv1");
    </script>
    

    Also in the {viewName}.tpl file I added this div:

    <DIV ID="caldiv1" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>
    

    I decided that I wanted the calendar to popup when I simply click on the date entry field. Here is my code:

    `<?php $options1 = array('size' => 8, 'onfocus' => "calx.select(document.forms[0]['order[expected_at]'],'dot1','yyyy-MM-dd'); return false;"); ?>
    <?php echo $form_helper->text_field('order','expected_at',$options1); ?>
    <a id="dot1" name="dot1">.</a>`
    

    ** Make sure to remove the backticks if you copy and paste! **
    I don't like the dot either, but it serves the purpose very nicely. Apparently the javascript needs an object with identical NAME and ID, from which to get the position on the page, to position the calendar DIV. I was to lazy to hunt thru the javascript to change it. :-)

    •  
      CommentAuthorjulio montoya
     
    It works!