Important function missing from source code.
Was just going through the source of code datetimepicker
HERE . the source code can be seen
HERE . now there is this function
-
- Date.prototype.dateFormat = function( format ){
- //you code for convert date object to format string
- //for example
- switch( format ){
- case 'd': return this.getDate();
- case 'H:i:s': return this.getHours()+':'+this.getMinutes()+':'+this.getSeconds();
- /*case 'h:i a': return ((this.getHours() %12) ? this.getHours() % 12 : 12)+':'+this.getMinutes()+(this.getHours() < 12 ? 'am' : 'pm');*/
- }
- }
That gets used in the plugin source line 15+ times but is not defined in the source at all , if you check the demo page it is defined in the HTML , is this an error by the plugin author , i know this is probably not the right place to ask , but still .
if i just import the plugin , and initialize the plugin like so:
- <input id="datetimepicker" type="text">
- $(function(){
-
- $('#datetimepicker').datetimepicker({
- format:'d.m.Y H:i',
- inline:true,
- lang:'ru'
- });
- });
I get the following error.
- Uncaught TypeError: start.dateFormat is not a function
unless i add this in my plugin code too
- Date.prototype.dateFormat = function( format ){
- //you code for convert date object to format string
- //for example
- switch( format ){
- case 'd': return this.getDate();
- case 'H:i:s': return this.getHours()+':'+this.getMinutes()+':'+this.getSeconds();
- /*case 'h:i a': return ((this.getHours() %12) ? this.getHours() % 12 : 12)+':'+this.getMinutes()+(this.getHours() < 12 ? 'am' : 'pm');*/
- }
- }
My question is why is the above code not included in the source code ?