owenmead / pikaday Goto Github PK
View Code? Open in Web Editor NEWThis project forked from pikaday/pikaday
A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS
License: Other
This project forked from pikaday/pikaday
A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS
License: Other
dbushell
has released 1.5.1
to fix Pikaday#598. Any chance you could merge this in? Thanks!
See Pikaday@a64b4cf.
i set autoClose: true but calendar auto close only after select date
See on this plnkr here:
http://plnkr.co/edit/bKU2SwyTDwgBG4XC3bxk?p=preview
Hey there. I just found your Extension. Great job. But:
If I picked a Date with Time I get sth. like this:
string(65) "Sat Aug 13 2016 18:00:00 GMT+0200 (Mitteleurop??ische Sommerzeit)"
Now I want to write my picked date and time in the database. Do I really need to substr the output? Or can I use the format I want to?
It doesn't seem that the dropdown times reflect the timezone (if using moment) but rather default to the user's timezone. I put through a very rough, quick fix here but it would be nice if this were worked out in a more consistent and robust way: newslynx@9f961db
Hi,
Before I start, let me thank you for pikaday-time
. It's a great library and it saved us a lot of time. So thank you for your hard work and making it happen. 🍻
I know you no longer maintain this repo but I'm still hoping that we can solve my problem somehow.
I've noticed that moment.js is just an optional dependency of the original Pikaday lib and I'm not sure if that's the case with your fork. I've noticed you marked moment as an optionalDependency
in your package.json so the answer is yes I guess.
We use pikaday-time
in our application and npm installs moment every time because it's a dependency of your lib.
We're building an angular app and we try to get rid of moment.js and switch to another date/time manipulation library which has a smaller footprint in the final bundle (e.g date-fns
). But since moment.js is a dependency hence npm installs it every time and Pikaday has a dynamic module loading strategy, moment will be part of the final bundle however we have eliminated everywhere in our source code.
I think if we set moment as a peerDependency
that would solve my problem.
I'd be more than happy to open a PR with this patch if you helped me with the release.
What do you think?
Hi, currently the time picker just sets midnight as the default time. How can I change this? Thanks!
At method "show" I alter the code to:
show: function () { if (!this._v) { removeClass(this.el, 'is-hidden'); this._v = true; //alter for clear the hour select box if (this._o.field.value == '') { this._d = new Date(); this._d.setHours(0); this._d.setMinutes(0); } this.draw(); if (this._o.bound) { addEvent(document, 'click', this._onClick); this.adjustPosition(); } if (typeof this._o.onOpen === 'function') { this._o.onOpen.call(this); } } },
When selecting the initially chosen time from the timepicker it seems as though onSelect
isn't firing. This is a problem because Timepicker does not seem to use the value of the defaultDate
passed to Pikaday to set the initial time, instead falling back on the first whole hour, so if the defaultDate
is 10:33 for instance, the initially set time is 10:00. It is then impossible to actually select 10:00 for the user since no onSelect
will fire.
Possible fix could be to fire onSelect
even if the chosen time is the same as the previous time.
Are there any options to keep the date time picker open when changing the hour
and/or minute
?
Or by adding a button which will perform the change after pressing it?
It's annoying to have to open the picker 3 times if you want to change the date and time.
I replaced my standard Pikaday
with this fork and I like the implementation, but I have several fields in forms that are Date
only, not DateTime
. I tried to implement the options for turning off Hour and Minutes in specific fields, but they are still showing up everywhere.
Is it not possible to selectively disable the Hour and Time functions?
Are there plans to keep this fork up-to-date with the upstream project?
Thanks for the fork that adds time support.
One thing I'm noticing is that the datepicker closes before the user is able to set the time if they select a date first.
Reproduction steps:
I think it would be useful if Pikaday-time stayed open until a user has a chance to select both a date and a time.
Would be cool if you renamed this to something like 'pikadaytime', updated the package.json, and published to npm. I can do it, but it seems kinda lame to make a fork just for that.
Whatever you decide, thanks for the work!
i dont want have default date, what line i should modifier in js file ?
I have installed the library through jspm: [https://www.npmjs.com/package/pikaday-time]
jspm install npm:pikaday-time
and using in my code as:
import "pikaday-time";
....
picker = new Pikaday({
field: ..... ,
onSelect: () => {.... },
onOpen: () => {.... },
showTime: true
});
....
Run time Error: "Pikaday is not defined"
Then I check the library dbushell/Pikaday and found that below 2 lines are present in file: [email protected]/pikaday.js after installation
"format global";
"deps ./css/pikaday.css!";
So, after adding above 2 lines in installed file: [email protected]/pikaday.js in place of
"format cjs";
everything seems to be working fine.
Kindly let me know if I am doing anything wrong or is there any problem with the installation or usage in the code.
I've dropped in ownmead/Pikaday to add time selection over dbushell/Pikaday, but the Pikaday window appears in entirely the wrong place. dbushell's appears in the correct space, but the current version here appears at left: -540px on my space.
This commit seems to be the one that fixes things for me if I start replacing Javascript: Pikaday@6ec802c
Will this ever happen? :D
Thanks
I notice some fixes (e.g. #16 - month/year selectors not working) seem fixed in master but not in the latest release (1.3.3). Can we have a new tag/release with the latest improvements? I prefer not to take from master for production code.
Hi, you forgot to update npm package to the 1.3.3 version (it's still 1.3.2 there)
We've been trying to integrate timezones into our time pickers with some frustration - behind this we,re using Moment & Moment Timezone to deal with the dates - see Proof Of Concept here: https://jsfiddle.net/glenpike/d2w664ar/11/
It would be nice if we could make the pickers show times (and be able to pick times) with a timezone offset, but the only way to achieve this is to make it completely unaware of the timezone - here's a demo of the different ways we've tried. (Only the bottom section "works")
Is there a way to set the min-max time? For example, I have a form that would accept only working hours, .e.g 8:00 - 18:00.
Optimally the visitors would be able to choose from this time range, and the default time woudl be set to the starting hour.
it would be my expectation that when the pika is opened, the minute and hour is set to be that of the current hour and minute of the day, this does not seem to be the case.
Is there a way to do this that i am missing?
Hi Owen, thanks for this nice code. I can't seem to make incrementMinuteBy working. I specify incrementMinuteBy: 5 or any other values and the increment remains 1 showing minutes form 0 to 59 stepping 1.
Could you kindly help? Thx.
Can we format date and time string to use this control for reminder.
reminder Sat June18, 2016 at 8:06:00 AM.
With time i am stick to use 1 format. Can we?
Hi,
thanks for this wonderful addition to Pikaday.
The only thing that bugs me is that a lot of commits have been added to the main branch that are not there. Do you think you could merge them?
Thanks a lot for the nice work ;-)
Hi,
In this new version you can't select nothing.
The problem is here:
https://github.com/owenmead/Pikaday/blob/master/pikaday.js#L462
If you remove this line working properly.
I don't know why this line...
https://github.com/dbushell/Pikaday/blob/master/pikaday.js#L408
Regards!
I edited the example to have the same options, with the exception of showTime
that is false for the first one and true for the next one.
The code for both:
<script>
var picker = new Pikaday(
{
field: document.getElementById('datepicker'),
firstDay: 1,
minDate: new Date(),
showTime: false,
});
var timepicker = new Pikaday(
{
field: document.getElementById('datetimepicker'),
firstDay: 1,
minDate: new Date(),
showTime: true
});
</script>
I think npm is very particular about the version number patterns, and 1.3.0.1 doesn't fit semver, resulting in the error "Invalid version"
Could the version be bumped to 1.3.1?
Currently there is a "close on select date" setting that allows the datetime picker to be automatically closed after the user selects a date. For parity between date and time functionality, a "close on select time" setting that allows the datepicker to be automatically closed after the user selects a time would be useful.
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.