tempusdominus / core Goto Github PK
View Code? Open in Web Editor NEWTempus Dominus Core
Home Page: https://tempusdominus.github.io/core/
License: MIT License
Tempus Dominus Core
Home Page: https://tempusdominus.github.io/core/
License: MIT License
When do you think you might have some basic documentation on how to import and render the modules?
_notifyEvent
does not emit those events when date and oldDate are null.
This is annoying if we want to plug to those events (for example we remove the overflow to make the popup fully visible).
I think for those 2 events it makes sense to emit with a null date.
Calling viewDate
function with a valid moment object as argument does not notify changes to the view. Something like $('#datetimepicker1').datetimepicker('viewDate', moment('11/21/2018', 'MM/DD/YYYY') );
has no effect on the datetimepicker.
Live example on this question on Stack Overflow using jQuery 2.1.1, moment 2.22.2, bootstrap 4.1.3 and tempus dominus 5.1.2.
I think that the issue is the _notifyEvent
function that always returns without trigger event since:
if ((e.type === DateTimePicker.Event.CHANGE && (e.date && e.date.isSame(e.oldDate)) || !e.date && !e.oldDate))
is always true when this._viewUpdate()
is called from viewDate
function.
If I call
myJqueryObj.datetimepicker('locale', newLocale)
the texts in the popup calendar (e.g.: day names) do not change. Calling
myJqueryObj.datetimepicker('format', newFormat)
works, so I guess the problem is not in my code :).
Reproduced with tempusdominus-bootstrap-4 5.0.0-alpha9
This issue was previously reported on tempusdominus/bootstrap-4 for a long time but it probably belongs to core:
Reproduce:
go to tempusdominus site, usage, no icon
click on field (it is filled with today's date)
immediately clear this field (don't click anywhere, ctrl-A delete will do)
click outside
console will display:
tempusdominus-bootstrap-4.js:1947 Uncaught TypeError: Cannot read property 'isSame' of undefined at TempusDominusBootstrap4._updateMonths (tempusdominus-bootstrap-4.js:1947) at TempusDominusBootstrap4._fillDate (tempusdominus-bootstrap-4.js:2116) at TempusDominusBootstrap4._update (tempusdominus-bootstrap-4.js:401) at TempusDominusBootstrap4._setValue (tempusdominus-bootstrap-4.js:430) at TempusDominusBootstrap4._change (tempusdominus-bootstrap-4.js:493) at Function._jQueryHandleThis (tempusdominus-bootstrap-4.js:2699) at r.fn.init._jQueryInterface [as datetimepicker] (tempusdominus-bootstrap-4.js:2706) at HTMLInputElement.<anonymous> (tempusdominus-bootstrap-4.js:2734) at HTMLDocument.dispatch (jquery-3.2.1.slim.min.js:3) at HTMLDocument.q.handle (jquery-3.2.1.slim.min.js:3) _updateMonths @ tempusdominus-bootstrap-4.js:1947 _fillDate @ tempusdominus-bootstrap-4.js:2116 _update @ tempusdominus-bootstrap-4.js:401 _setValue @ tempusdominus-bootstrap-4.js:430 _change @ tempusdominus-bootstrap-4.js:493 _jQueryHandleThis @ tempusdominus-bootstrap-4.js:2699 _jQueryInterface @ tempusdominus-bootstrap-4.js:2706 (anonymous) @ tempusdominus-bootstrap-4.js:2734 dispatch @ jquery-3.2.1.slim.min.js:3 q.handle @ jquery-3.2.1.slim.min.js:3 trigger @ jquery-3.2.1.slim.min.js:3 (anonymous) @ jquery-3.2.1.slim.min.js:3 each @ jquery-3.2.1.slim.min.js:2 each @ jquery-3.2.1.slim.min.js:2 trigger @ jquery-3.2.1.slim.min.js:3 _notifyEvent @ tempusdominus-bootstrap-4.js:567 _setValue @ tempusdominus-bootstrap-4.js:425 _change @ tempusdominus-bootstrap-4.js:493 _jQueryHandleThis @ tempusdominus-bootstrap-4.js:2699 _jQueryInterface @ tempusdominus-bootstrap-4.js:2706 (anonymous) @ tempusdominus-bootstrap-4.js:2734 dispatch @ jquery-3.2.1.slim.min.js:3 q.handle @ jquery-3.2.1.slim.min.js:3 tempusdominus-bootstrap-4.js:2501 Uncaught TypeError: Cannot read property 'clone' of undefined at TempusDominusBootstrap4.hide (tempusdominus-bootstrap-4.js:2501) at Function._jQueryHandleThis (tempusdominus-bootstrap-4.js:2699) at r.fn.init._jQueryInterface [as datetimepicker] (tempusdominus-bootstrap-4.js:2706) at HTMLInputElement.<anonymous> (tempusdominus-bootstrap-4.js:2744) at HTMLDocument.dispatch (jquery-3.2.1.slim.min.js:3) at HTMLDocument.q.handle (jquery-3.2.1.slim.min.js:3) at Object.trigger (jquery-3.2.1.slim.min.js:3) at Object.simulate (jquery-3.2.1.slim.min.js:3) at HTMLDocument.c (jquery-3.2.1.slim.min.js:3) hide @ tempusdominus-bootstrap-4.js:2501 _jQueryHandleThis @ tempusdominus-bootstrap-4.js:2699 _jQueryInterface @ tempusdominus-bootstrap-4.js:2706 (anonymous) @ tempusdominus-bootstrap-4.js:2744 dispatch @ jquery-3.2.1.slim.min.js:3 q.handle @ jquery-3.2.1.slim.min.js:3 trigger @ jquery-3.2.1.slim.min.js:3 simulate @ jquery-3.2.1.slim.min.js:3 c @ jquery-3.2.1.slim.min.js:3
When using with useCurrent
to false
, the _change
method calls _setValue
without any index and so the value is stored at an undefined
index in _dates
. So later when calling date
, the index is set by default to 0 but there is no value at this index.
I think _sevValue
should fallback to 0
when index is undefined.
I believe there is a bug when you use the datepicker with no icons and there is a value set for the input. A maximum call stack size exceeded exception is being raised.
Check out the example.
https://jsfiddle.net/3cqL9t3x/61/
Hi,
The doc say:
This new version has been completely rewritten in ES6 and uses Babel to transpile the code down.
But jquery is still mentioned as a dependency. Is Tempusdominus using jquery still or is it just needed voor moment.js (and popper.js).
Greetz, flexjoly
Hi there,
i dont know if it fits here or on the boostrap4 repo that is use.
Problem:
I want to change the disabled time intervals for every selected date.
Current Outcome:
All hours are accepted after i changed a date.
Wanted Outcome:
The new interval is accepted and i cannot select the disabled times.
Here is a code example: https://jsfiddle.net/m6b0a8qf/1/
Thanks for the project and looking into this,
Dominik
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.