Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7939679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:10:30+00:00 2026-06-03T23:10:30+00:00

I am using Zendx Jquery to implement the datapicker. I need to disable certain

  • 0

I am using Zendx Jquery to implement the datapicker. I need to disable certain dates, I can do this the manual way of adding the JS to the layout html page but Zendx renders it on the page for you.

The code below works when adding the JS to the layout page:

var unavailableDates = [
new Date(2012, 1, 20).valueOf(),
new Date(2012, 1, 27).valueOf()
];

function unavailable(date) {
if (date.getDay() === 1 && $.inArray(date.valueOf(), unavailableDates) < 0) {
    return [true, ""];
} else {
    return [false, "", "Unavailable"];
}


$(document).ready(function() {
$("#date").datepicker({
    beforeShowDay: unavailable
});
});​

When I do it with Zendx heres my form code:

$birthdate = new ZendX_JQuery_Form_Element_DatePicker('birthdate');
    $birthdate->setLabel('Return Date:')                    
                ->setJQueryParam('dateFormat', 'dd.mm.yy')
                ->setJQueryParam('changeYear', 'false')
                ->setJqueryParam('changeMonth', 'true')
                ->setJqueryParam('regional', 'en')
                ->setJqueryParam('yearRange', "2012:2012")  
                ->setJqueryParam('minDate', +1)
                ->setJqueryParam('maxDate', "+1m +10d")                 
                //->setValue(Zend_Date::now()->toString('dd.MM.yyyy'))              
                //->setJqueryParam('beforeShowDay', unavailableDates)
                ->addValidator(new Zend_Validate_Date(
                array(
                'format' => 'dd.mm.yyyy',
                )))
                ->setRequired(true);

It renders it at the top of the page:

<script type="text/javascript">

//

$(document).ready(function() {
$(“#birthdate”).datepicker({“dateFormat”:”dd.mm.yy”,”changeYear”:”false”,”changeMonth”:”true”,”regional”:”en”,”yearRange”:”2012:2012″,”minDate”:1,”maxDate”:”+1m +10d”,”beforeShowDay”:”unavailableDates”});
});
//]]>

And I get a console error:

Uncaught TypeError: Object unavailableDates has no method ‘apply’

It wont call the function unavailableDates but it just wont work. Anybody had the same issue?

Cheers

J

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:10:32+00:00Added an answer on June 3, 2026 at 11:10 pm

    I have sorted it by disabling Zend Rendering Javascript onLoad by changing the view. So now Zendx only loads in the libraries and I can run my own datepicker code in the layout :)!

    this->view->jQuery() ->setRenderMode(ZendX_JQuery::RENDER_LIBRARY);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jQuery-UI Datepicker (via ZendX view helper) to select dates. Now I
I need to have an autocomplete functionality using jquery, and I've encountered ZendX_JQuery which
Hi I am trying to implement a autocomplete field using Zend Jquery. I followed
How can i debug a jquery.js file using zend debuggger? Is it possible or
I've been using Zend and need a search. The Zend docs aren't great so
I am using zend framework on windows. I want to implement ajax in my
How can i add my own jQuery plug-in located in my zf path public/js/isround.js?
I am using jquery UI tab for my project. Kindly check the html code
I've a form that is being validated with Jquery's Validation Plugin and I need
How can I stop Layout rendering, when sending request through AJAX.. The problem I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.