GithubHelp home page GithubHelp logo

owenmead / pikaday Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pikaday/pikaday

153.0 153.0 73.0 528 KB

A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS

License: Other

CSS 18.48% HTML 2.75% JavaScript 78.77%

pikaday's People

Contributors

andreynering avatar billyvg avatar bquorning avatar dbushell avatar dylanfm avatar eadmundo avatar elwayman02 avatar everdimension avatar jeroenbourgois avatar leizhao4 avatar lvl99 avatar mattrobenolt avatar maxbeatty avatar moox avatar nathancahill avatar noyainrain avatar owenmead avatar paulmillr avatar pts-michaelvera avatar qchouleur avatar radiac avatar rikkert avatar robdel12 avatar stah avatar stanton avatar stephenjwatkins avatar stuart-bennett avatar stuartmcfarlane avatar vadorequest avatar zestrid3r 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

pikaday's Issues

Correct Time-Format for php/mysql in value

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?

Timezone support

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

moment shouldn't be a dependency

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?

Set default time?

Hi, currently the time picker just sets midnight as the default time. How can I change this? Thanks!

Multiple pickdays get the old hour on open

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); } } },

onSelect not called when choosing already selected value

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.

Options to keep the picker open

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.

how to disable time collection for fields that are Date only

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?

Pikaday-time closes before you can set the time

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:

  • Open Pikaday-time datepicker
  • Select date
  • Pikaday-time datepicker automatically closes
  • Open Pikaday-time datepicker a second time
  • Select time
  • Pikaday-time datepicker does not automatically close
  • Click outside of datepicker to close it

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.

Rename + NPM

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!

default date

i dont want have default date, what line i should modifier in js file ?

Getting runtime Error: "Pikaday is not defined" after "jspm install"

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"
pikaday-time_error

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.

Wonky positioning

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

New tag with latest fixes

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.

Update npm package

Hi, you forgot to update npm package to the 1.3.3 version (it's still 1.3.2 there)

Deal with Timezone offsets nicely (enhancement / wishlist)

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")

https://jsfiddle.net/glenpike/hetovqq8/3/

Set min-max Time

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.

Hour / Minute isn't set from defaultDate

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?

incrementMinuteBy not working

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.

Custom format?

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?

Integrate the last commits from dbushell

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 ;-)

`minDate` is a day later when showing time

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>

And the result:
image

Add "close on select time" setting

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.

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.