GithubHelp home page GithubHelp logo

nehakadam / datetimepicker Goto Github PK

View Code? Open in Web Editor NEW
357.0 357.0 114.0 1.42 MB

Responsive jQuery DateTime Picker plugin for Web & Mobile

Home Page: https://nehakadam.github.io/DateTimePicker/

License: MIT License

JavaScript 98.02% CSS 1.98%
datetimepicker javascript jquery

datetimepicker's People

Contributors

adrianfalleiro avatar aiphee avatar allenm avatar bhulsman avatar calvin-he avatar carlosagp avatar cpolzer avatar eastroots92 avatar gitter-badger avatar j3k0 avatar jacoor avatar jasonychuang avatar kristophone avatar kylex avatar lajpatshah avatar lukasdrgon avatar macfanatic avatar nehakadam avatar pixelplant avatar pusle avatar radkill avatar reptarsrage avatar timedropssb avatar torounit avatar trueeddie avatar uxxman avatar yanike avatar zevero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datetimepicker's Issues

Twitter bootstrap modal issue

If you put the datetime picker in a Twitter bootstrap modal, select/set a date/time, then close the modal, you can't open the modal again.

I found removing "$(document).unbind("click");" on line 577 fixed the issue. But I have no clue what other issues that will cause.

Problem with setting input values to datetimepicker manually

Hi,

Want to set time values manually in input box by typing, but it is not updating the manually typed values in the result box. Also when you delete the hour input box value and pressed "Tab" key to go in next input box for selecting the minutes values, it updating the hour input box values to "NaN" values.

Multiple Pickers with Different Minute Intervals

Is it possible to have multiple pickers? For example, how could I have two time pickers, one with a 1 minute interval, and another with a 5 minute interval? It doesn't seem like I can assign an input to a specific picker.

Multiple Languages

Could you make a separate language file?

This makes it easy to translate the file and multilingualism.

AM/PM button not working

Hi,

I use DateTimePicker on my project today and find AM/PM compButton dose not work. Other compButton work well. After debugging I fixed it by the following change:

DateTimePicker.js, Line 1589:

$(oDTP.element).find(".meridiem .dtpicker-compButton *").click(function(e)
->
$(oDTP.element).find(".meridiem .dtpicker-compButton").click(function(e)
Remove the asterisk.

Please verify this problem. Hope my solution helps.

Thanks,

Sen

Question about the date/time

first wanted to say this is great but I have a question, how would one go about comparing the dates between two pickers? You have a start date and end date but you don't want that date to be set longer than the start date.

dateSeparator

When amending the dateSeperator to anything but '-', the datetimepicker seems to fall over and not display correctly.

I would like the component to output dates in the format : dd/mm/yyyy HH:mm

Am I going about it the correct way?

Missing Cases in _parseDateTime()

Hello,

If you have the dateTimeFormat set to "MM-dd-yyyy hh:mm AA", it is not popping up the date-time picker with the pre-populated date (only the time). The date gets filled in with the default.

I think you are missing some cases when parsing the date portion in your if-else block within the _parseDateTime() function. For example bArrMatchFormat[11] would (I think) cover this one but there are others missing too.

is there a way to pick seconds ?

is there a way to pick seconds ?

the source has options like "yyyy-mm-dd HH:mm:ss" , but add datetimeFormat attr seems not work fine , can you help me ?

Picker breaks when opening/closing very fast.

When I open/close picker very fast suddenly there is only an empty rectangle under the input instead of picker window.

To fix this I tried to minimize "animationDuration" from 400 to 50.

Bug!

I've discovered a minus bug. When clicking inside minutes (dtpicker-compValue) and then click minus or plus sign (no matter which of the four buttons), DateTimePicker window closes without ever press Set or Clear buttons...
Do you have any idea how to fix it?
Thank you

Dialog blink twice

When I implement the datetimepicker using [input data-field="date"] tag, when click it blink twice. It happen on the demo site too.

But if I implement on [span data-field="date"] tag, it works.
The issue is I want to implement using [input] so it will POST by [form] but it will cause double blinking effect. Not sure is just me or anyone having this issue as well?

Is there any workaround? Thanks.

fill input field with date from database

Hi,
I'm using this plugin to create and edit an entity Event. It has a start and an end. They are both saved as Date into the mysql database.
In creation of Event everything works ok, I've also set up a custom separator and a date time format.
I also need that, when user want to change start or end date, it is shown into a same input field, but it is shown with another format, for example

2015-04-09 13:50:00.0

and when I click on the input field I have the following exception on console:

TypeError: sString1 is undefined
on line 1747 of DateTimePicker.js

Why does it happens?

dynamically adding new date pickers

Hi

We encountered an issue with the Date Time Picker when we dynamically allowed users to add and remove fields on our application forms.

The fix we found was the following function, it might come in handy for you guys

$.fn.ResetDateTimePicker = function (options) {
return this.each(function () {
if ($.data(this, "plugin_" + pluginName))
jQuery.removeData(this, "plugin_" + pluginName);

            if (!$.data(this, "plugin_" + pluginName)) {
                $.data(this, "plugin_" + pluginName, new DateTimePicker(this, options));
            }
        });
    };

What this allowed us to do was give the user the flexibility of adding and also removing date time picker fields, without compromising on functionality.

If a datetime format has been defined, but initial data without time portion, runtime error will be given out

At line #1832 of DateTimePicker.js, if datetime format has been defined, it assumes the time portion will always exist. However, this assumption is not always true. The following example is demonstrated how to break it:

input type="text" value="2015-09-12" data-field="datetime" data-format="yyyy-MM-dd HH:mm:ss" readonly

I suggest to modify it as follows:

sTime = sArrDateTime[1];
if (typeof sTime == 'undefined') {
if(oDTP.oData.bIs12Hour) {
sTime = "12:00:00 AM";
}
else {
sTime = "00:00:00";
}
}

fill second field with first field value and validation

Hi, I have two input fields with date. They describes starting and ending time of an event.
I would like that, when user selects the first datetime, the second is automatically filled with the same value. I would also add a sort of validation that allows me to check if datetimes are correct (first datetime must be previous of second datetime)
Thanks

Angular

Hi, thanks for the component. It's exactly what I was looking for.

I'm studying some technologies and I'm using angular. The component works fine, but its values isn't setted on the $scope variable of angular.
The others inputs in the page are working fine with angular.

Have you any idea of what's happening?

Use with jQuery Mobile

Hello,

I don't have an issue, but rather a question, and I couldn't find anywhere else to inquire with the developers.

Has anyone tried/successfully used this plugin with jQuery Mobile?

I am looking for a datetime picker combo that will work well with jquerymobile.

Thanks

oElement not set _hidePicker

In _hidePicker the oElement variable is not defined and also the afterHide function is not working because of this reason.
...
var oElement = dtPickerObj.dataObject.oInputElement;
...
fixes the problem temporarly for me.

Thx for your work, nice DateTime picker.

Greets

re1d1

use it with asps page and runat="server"

Hi, if i try to use it with runat="server" in aspx page , input become invisible it exist on page but it was decorated with attributes that hide the control ( i call the page from desktop with IE 11)

it is rendered in this way

thank you

Change popup target...

Can you please tell me how to make the popup open above the parent window? i have a single page app im using this on but it pops up in the child partial-view rather than above the parent item. Any help with this would be appreciate!

Show it from a button

Hi there!

I'm using your awesome plugin and I'd like to open it programatically, let's say I have it "linked" to a hidden imput and I want to press a button and display the picker... is that possible? If so, please, could you tell me how?

Thanks!

dateSeparator - only dash and slash ??

Hello! I'm trying to configure this datepicker, but can it work with dot(".") as dateSeparator? And can I set "shortMonth" to returning date like "01 Dec 2014" ?? thanks!

Issue with the date picker

When i edit the year directly in that textbox without using the + or - sign and after that if i try to edit the month or date through + or - sign then date picker is automatically closed without pressing the set button which should not be done, I don't want to automatically close the datepicker until set button is pressed

Meridiem custom content missing click event binding

On line 1589 of DateTimePicker.js, the JQuery selector statement does not include custom elements a user may decide to place within the .dtpicker-compButton element, which is supported by the current API. For example, I placed an arrow image within this element. The arrow image did not have the correct click event binding because the selector on this line in the code was not complete.

Line 1589 of DateTimePicker.jsline should be updated to the following:
$(oDTP.element).find(".meridiem .dtpicker-compButton *").click(function(e)

custom firing picker show

Hi! Is there any way to custom trigger picker show event? In my case i need ability to show picker by clicking on other element.
And i having a trouble with iOs 8.2 safari on iphone 4s. It ignores readonly prop in markup and firing default focus event.
Thanks!

Default date-time shows time when page was loaded, not current time.

I would expect the datetime to default to the current time when the user clicks into the input field, rather than the time when the page is loaded. Consider the scenario where a user has a page open for over an hour, then the user opens a datetime picker and sees a disparity between the current time and the time being shown by default. Of course, if the developer specifies a default datetime, then this should be shown, but otherwise the default should be the current time NOT the time at which the page was loaded.

There are three lines that need to be addressed in DateTimePicker.js:
line 1662: var dTempDate = new Date(oDTP.settings.defaultDate),
line 1727: var dTempDate = new Date(oDTP.settings.defaultDate),
line 1778: var dTempDate = new Date(oDTP.settings.defaultDate),

The code should check if defaultDate was not specified by the developer, then use the current time 'new date()'.

AM/PM defaults to AM

When using the format "mm-dd-yyyy hh:mm:ss AA"

The DateTimePicker always defaults to AM regardless of AM/PM entered for the date.

image

Facing problem when using two date picker in same page

I am facing one issue, i have taken the two date picker and i have set the max-date and min-date for both, but the problem is, it is only considering min-date and max-date of only one, not for the other date picker, what to do ?

Bug with JQM.

Bug with JQM.
After opening the Date Picker once, I can't open any JQM popup.

JQ Files :
jq : JQuery/jquery-1.7.2.js
jqm : jquery.mobile-1.4.2.js

Undefined Value

Hi,

Im trying to use this as a datapicker for selecting a departure date. but when i try and send the data with an ajax call the value is showing up as undefined.

I have created a test area with jsfiddle and im also getting undefined on there. What am i doing wrong? / Is this a bug within the plugin?

My jsFiddle is http://jsfiddle.net/Lpkerxv8/

Here is my test code.

<input runat="server" id="tbStartDate" CssClass="tbDate tbStartDate" type="text" data-field="date" placeholder="Departure Date" readonly>

<div id="dtBox"></div>
<br /> 
<br />   
<a class="btn-filter-properties">
    Search
</a>
$("#dtBox").DateTimePicker({
    titleContentDate: "",
    dateFormat: "dd/mm/yyyy",
    dateSeparator: "/",
});

$(".btn-filter-properties").click(function () {
    alert("Departure Date: " + $(".tbStartDate").val());
});

What about internationalization?

Hi there. Congrats for the great plugin!

Sorry for the numb question, but I'm new to web development and I've been trying to manually translate the plugin, so my doubt is: Is there a way to set other languages to it?

Thanks in advance.

Make AMD and CommonJS friendly

What do you think about wrapping the plugin in a UMD declaration to make it compatible with AMD and CommonJS environments.

Something similar to this https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js

Also, removing Grunt and its plugins from dependencies in the package.json file as they're already under the devDependencies field and adding jquery as a dependency.

Happy to submit a PR if you think it would be a good idea

Cant Get Timepicker

My script works perfect for date-time mode but i need only to display time but it says function is undefined. I even changed the mode in the original DateTimePicker.js but nothing. How do I get only the time to display? Please advise.

Multiple TimePicker not working properly

Hi Guyz,

I am using this plugin for one of my website and on multiple text fields, But the problem is when one datetimepicker is open and i click on the another time picker text box there is no intreaction happens,, so i just want to destroy the another popup's and reinitialize the datetimepciker to the clicked textbox....

Please Help Me on this...

[Feature request] formatHumanDateTime

Hi,

first of all thank you for the nice work and DateTimePicker.

I have a feature request. It would be nice if you can define a seperate function for each type of Date, Time or DateTime for human readable Output, like it can be defined for "formatHumanDate".

Something like formatHumanDateTime.

yours sincerely

re1d1

"Current date" within popup is stale

Say you call $("#el").DateTimePicker() at 1pm... and you sit on the page for 2 minutes. By the time you focus on the field, thus opening the popup, the popup will still indicate that it's 1pm and not 1:02pm.

Seems like it would be better to recalculate the current time every time the popup is opened?

bower.json mainfile problem

In bower.json, main property had been duplicated doesnt define css file in the end.
It couses not to concat css file automatically on grunt tasks. I needed to define mine manually.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.