Zend Framework Date Time Picker - javascript

I'm a real newbie in programming and finally got the ZendX Jquery to work. However, I would like to include a date time picker, and found an option at http://www.binpress.com/app/zfdatetimepicker/85 . However, the documentation is not complete and I would really want to set it up correctly. Can anyone help me with the steps required to do so? I tried setting it up and got the error " Object doesn't support property or method 'datetimepicker'". Thanks.

It sounds like you need to include the jquery UI script files. Looking at his demo, it is pulling in jQuery UI 1.8.21 from jquery's 'code' servers. I also know that without the UI component included, you will get the error message Object doesn't support property or method 'datepicker' when you do something like $('#myDate').datepicker. So I'm assuming you're just missing the correct script includes.
I've not used zend-framework at all, so I might be missing something on that side.

Related

Is moment.js and moment.php the same?

I have created a js script using moment.js and I want to replicate it through a cron job. So, it will be in PHP.
So, I searched for moment.js equivalents and I found this https://github.com/fightbulc/moment.php
Technically speaking, they are not the same. The GitHub repo says:
Parse, validate, manipulate, and display dates in PHP w/ i18n support. Inspired by moment.js
I read "inspired by" as similar in nature or close to. Otherwise, it would say something like "PHP port of Moment.js" or "PHP wrapper around Moment.js".
You should define more clearly, however, what exactly you mean by "are they the same". Do you mean the API parity? Or API compatibility? Or something else?
Well, it's not the same as it says "Inspired by the javascript library moment.js" at below mentioned sources :
1) https://packagist.org/packages/lawondyss/moment-php
2) https://github.com/fightbulc/moment.php
which means it is developed by taking the reference of the javascript library moment.js , it may contain the same functionality as well as it's own (newly added than the javascript moment.js).
You can compare the two from downloading/checking the documentation from different sources as below :
1) for moment.js you can check here : https://momentjs.com/
2) for moment.php you can check here : https://github.com/fightbulc/moment.php OR
https://packagist.org/packages/lawondyss/moment-php

What happened to isZoomedIgnoreProgrammaticZoom?

I am using dygraph 1.1.0 since, well... forever :-)
Now I wanted to have a look at dygraph 2.0.0 and of course expected some migration to do.
Now, the only error I actually get after simply replacing the *.js files is:
Uncaught invalid option isZoomedIgnoreProgrammaticZoom dygraph.js:4448
When I remove this option from my code, everything still seems to work.
I could not find anything about the option in the new docs, so my question in:
What happened to isZoomedIgnoreProgrammaticZoom?
That option was removed in the 2.0 release.
That option affected the behavior of the isZoomed() method. If you're not using that method, you can remove the option without changing anything. If you are, it should be possible to get whatever behavior you want by using other methods in the dygraphs API. But I'd need more specifics to help.

How to load timezone files with timezone-js without Fleegix.js?

I want to use timezone-js in my app, but I'm not Fleegix.js, which "just works". The readme says to look in the spec file for an example, but it looks like that uses Node.js stuff. Is there a way to make a load for Jquery or just raw JS or something?
I got confused on those docs also. It's not quite clear, but jQuery support is already built in. You just have to set async to false to get it to work. Not sure why - since ajax is async anyway - but that's the flag to set to get it to work with jQuery. No other wireup is needed.
timezoneJS.timezone.zoneFileBasePath = 'scripts/tz';
timezoneJS.timezone.init({ async: false });
Also - there are other libraries that do the same thing. You may find one of these more appealing.

flowplayer html validation

Ok, Im trying to rebuild a clients website thats long over due for cleanup on the backend and under the hood. This client uses flowplayer for most of the videos seen on any of there sites, and while attempting to validate my code via w3c validator I notice that the validator is throwing 2 errors both pertaining to flowplayer in this case.
http://validator.w3.org/check?uri=http%3A%2F%2Fv2.newyorkbarshow.com%2Fhome&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3
I am using the latest flowplayer out, and following there example (which I don't know if that validates either). So I am wondering if it doesn't validate out of the box, if anyone happens to know a means of correcting it so it will validate.
You need to add data attribute with value "/static/imgs/static/VidAd4BarShow.swf" in your object tag.
note : I see this happens before flow player executes anything within your source...

initialization of dojo widget

I tried to create custom widget for my site. when I loaded page it says:
mixin #0 is not a callable constructor.
clsInfo.cls.prototype is undefined
I can't find any information about clsInfo, so I don't know what is it. maybe the problem that I use dojo from google:
and my own script is located on localhost. so when my dojo on page initializes something goes wrong with my script. I can't find any good info on dojo, maybe I search in wrong places?
please help me to resolve my problem
I ran into this when I was trying to override a dijit.Dialog so I could bind events to controls within it. We've yet to see if the binding part will work, but if you look at the source, this happens when one of the bases passed in as the second argument fails to resolve to an "[Object function]". In my case, I was passing a String in.
dojo.declare takes 3 arguments:
The name of the custom object "class" you're building
An array of base classes, parents to provide functionality (not the string names of those classes)
A hash of functions and declarations
So if I want to override dijit.Dialog, I have to do:
dojo.declare("myDialogType", [dijit.Dialog], {
function1() {/*Code*/},
function2() {/*Code*/}
}
I had ["dijit.Dialog"] as my second argument and that was the problem.
I strongly recommend using Web Inspector or Firebug with uncompressed local copies of the Dojo library rather than the CDN to figure out what's going on and debug these types of problems. Dojo's documentation is extensive but not complete in some areas and some behaviors have to be figured out by looking at what the code expects. That's not intended as a slight to the authors; once you get it going it's a pretty awesome product, and any documentation for volunteer work is appreciated.
Are you sure Dojo is loading? Did you put your code in a dojo.addOnLoad()? When using a CDN you sometimes run into issues with execution times. dojo.addOnLoad() will not only trigger when the DOM is loaded, it gets called when dojo resources have downloaded, such as dijit._Widget.
I've run into this problem when I screw up the order of my requires which makes _WidgetBase not what _WidgetBase really is. Seems like a simple spot to screw up.

Categories