Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Date picker #116

Closed
victoras opened this issue Jun 12, 2013 · 42 comments
Closed

Feature Request: Date picker #116

victoras opened this issue Jun 12, 2013 · 42 comments
Assignees
Milestone

Comments

@victoras
Copy link

Will be nice to have Date picker option.

@imjoeybrennan
Copy link

Totally agreed.

@ghost ghost assigned valendesigns Aug 9, 2013
@valendesigns
Copy link
Owner

Any help or thoughts towards getting this started?

@victoras
Copy link
Author

I think something identical will be perfect.

screen shot 2013-08-11 at 10 56 27 pm

screen shot 2013-08-11 at 10 56 44 pm

@valendesigns
Copy link
Owner

What software is that from?

@victoras
Copy link
Author

@jetonr
Copy link
Contributor

jetonr commented Nov 21, 2013

Hi there , I have my date & time picker working on option-tree but there is a problem with jquery-ui css. It changes some layout and fonts when en-queued on the back panel!

untitled-1

@valendesigns valendesigns mentioned this issue Jan 13, 2014
15 tasks
@jetonr
Copy link
Contributor

jetonr commented Jan 17, 2014

@valendesigns Derek i mentioned the problem before, I have the datepicker type created that adds a calendar but when I enqueue the jquery-ui.css smoothness file, the menu gets some background that looks bad. See the image and let me know if we can find a solution using a scope maybe!

ot_uidatepicker

@valendesigns
Copy link
Owner

It seems odd that WordPress doesn't have a built in Date Picker. We could just include the CSS that is required for the Date Picker and not the entire jQuery UI?

@jetonr
Copy link
Contributor

jetonr commented Jan 17, 2014

True, I was searching for a native WordPress Datepicker but there is none. If I can manage to add this one before the weekend can u push it with next patch 2.2.1 ?

@valendesigns
Copy link
Owner

I've already started working on it, I'll get it to play nice with the rest of the UI. As for including it in 2.2.1, sorry but that's a hotfix branch and this is a new feature. I'm keeping to a stricter branching model so this will be in 2.3.0 out next month.

@jetonr
Copy link
Contributor

jetonr commented Jan 17, 2014

Ok no prob. Heres how mine looks like so far. I also included the timepicker and have to style that too.
date_timepicker

@valendesigns
Copy link
Owner

Well I guess you should take point on it since you've gotten that far with the design. Looks good to me! Finish integrating the timepicker and send over a pull request on the wip branch. Thank you @jetonr

@jetonr
Copy link
Contributor

jetonr commented Jan 17, 2014

OK, I need couple of hours and its done.
Another question Derek, should i add 2 new types datepicker (only with calendar) and datetimepicker (with both time and calendar) and the css styles I am adding to the end of existing ot-admin.css

@jetonr
Copy link
Contributor

jetonr commented Jan 18, 2014

This is my final version. I created a pull request on wip branch.
date_time_picker

@valendesigns
Copy link
Owner

@omid-khd Please do a pull on wip and check that the RTL support for both the date picker and date time picker work as expected.

@omid-khd
Copy link

sorry for being a beginner but may i ask what is a pull and what it can do?also i tested the date and time pickers they look good just need to set text indent property to hide next and prev labels.
dtp

@jetonr
Copy link
Contributor

jetonr commented Jan 19, 2014

@omid-khd check the image bellow, is this how it should look like properly in RTL!
@valendesigns the prev and next button are overlapping sat are sun they need to be hidden and this feature is good2go
rtl_date_picker

@omid-khd
Copy link

@jetonr the important thing in rtl languages that have more priority is text therefore it isn't necessary to show date/time picker on right.just negative value of text indent become positive for hiding labels.

@valendesigns
Copy link
Owner

@jetonr I've updated the CSS and the next & previous buttons should now be fixed.

@omid-khd If you're not yet familiar with git and what a pull is please download the wip branch here https://github.com/valendesigns/option-tree/archive/wip.zip and do your testing in your local WP install. If you need help getting setup for the future please email me and I'll walk you through it. derek[at]valendesigns.com

@valendesigns
Copy link
Owner

Seems there's a style issue in firefox with the calendar being pushed over a pixel. Looking for a fix now. Chrome looks perfect, as always.

@valendesigns
Copy link
Owner

OK, firefox should now be fixed.

@omid-khd you are happy then with the rtl support of the date picker?

@jetonr
Copy link
Contributor

jetonr commented Jan 19, 2014

only in IE11,IE10,IE9: @valendesigns when i click today in the datepicker the calendar closes and opens again.
IE 8 and below not supported :)

@valendesigns
Copy link
Owner

@jetonr That sounds annoying. However, I don't have IE11 to test and fix it. Also, it would be a bug with the jQuery Date Picker itself and is something jQuery would need to fix.

Does it insert the date into the input field? As long as it's doing what it's meant to do then it's something we'll have to live with unless you can find a solution.

@jetonr
Copy link
Contributor

jetonr commented Jan 19, 2014

@valendesigns yes ie9 does insert the date properly, but have to click outside the calendar to close it.
In ie8 it doesn't show at all when the field is clicked.

@valendesigns
Copy link
Owner

@jetonr I F'ing hate IE. How about the date time picker?

@jetonr
Copy link
Contributor

jetonr commented Jan 19, 2014

@valendesigns Same doesn't show. I hate that ie8 stil has a market share from 6-8% in 2014. We can redirect them to http://theie8countdown.com/ lol

@valendesigns
Copy link
Owner

Unfortunately IE is a piece of shit regardless of the version. I have yet to be impressed by any of the releases of IE and even though they make nice commercials demonstrating how awesome their browser is, it always falls short in the real world.

I guess first thing to check is if the date picker on the jQuery site works in IE and if it has the same behavior as we're experiencing.

@jetonr
Copy link
Contributor

jetonr commented Jan 19, 2014

Already did that. Checked em both and works on jQuery site and the datetimepicker they both work even with ie7

@jetonr
Copy link
Contributor

jetonr commented Jan 19, 2014

SCRIPT5009: 'OT_UI' is undefined
SCRIPT1010: Expected identifier
This is console from ie8 @valendesigns

@valendesigns
Copy link
Owner

Okay then, that's weird. It's probably something to do with the way the JS is written. Unfortunately, you're going to have to fix it. I can help in Skype if you want?

@valendesigns
Copy link
Owner

You responded at the same time.

@jetonr
Copy link
Contributor

jetonr commented Jan 19, 2014

Ok let me know what can i do or skype:jetonr

@valendesigns
Copy link
Owner

This feature is now considered completed - please comment if you find something wrong. Also, we are dropping support for IE8 at this time.

Thank you @jetonr for contributing your code!

@omid-khd
Copy link

@valendesigns rtl version looks good on firefox.
i test it on chrome 32 and labels still exists.
opt

@jetonr
Copy link
Contributor

jetonr commented Jan 20, 2014

@omid-khd you have to clear you cache on chrome OR do a ctrl + f5 refresh OR try opening an incognito window and check if the labels are still there. I don't see them after Derek added text-indentation to span.

@omid-khd
Copy link

@jetonr it maybe from my cache but i do what you said and still the same.also i test plugin on ie9 (never test it before for date/time picker) and it looks the same.
i dont know maybe something is wrong with my computer.

@jetonr
Copy link
Contributor

jetonr commented Jan 20, 2014

@omid-khd check if you have the latest changes: open assets/css/ot-admin.css see if you have the following code starting from line 1621. If not download the file again from
https://github.com/valendesigns/option-tree/archive/wip.zip

.ui-datepicker-prev span, 
.ui-datepicker-next span {
    text-indent: -9999px;
}

@jetonr
Copy link
Contributor

jetonr commented Jan 20, 2014

You were right @omid-khd they still show even with text-indent:-9999.
@valendesigns i replaced text-indent with display:none for ui-datepicker-prev span and it doest the trick on ie, safari, chrome, firefox

@valendesigns
Copy link
Owner

@jetonr & @omid-khd it's been updated to display: none; on the wip branch. Cheers!

@victoras
Copy link
Author

How to change the date format?

@jetonr
Copy link
Contributor

jetonr commented Feb 24, 2014

@victoras i just added a filter to modify date format. Maybe @valendesigns will add it to the upcoming 📦 hot-fix. If you want to use it now see my latest pull-request on option-tree.

The function to change date_format:

function jrweb_ot_date_format( $date_format ) {

    return $date_format = 'd M, y';
}
add_filter('ot_date_format', 'jrweb_ot_date_format', 10, 1);

To see avaliable dateformats for jquery ui datepicker refer to http://api.jqueryui.com/datepicker/#utility-formatDate

@victoras
Copy link
Author

Thanks @jetonr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants