How can I make a calendar in php so that the users will not have to input the date manually.
It's more a javascript feature, actually.
There are many javascript library to do this. One of it is jQuery UI DatePicker. I highly recommended this one.
I've been using the js calendar from http://www.dynarch.com/ and it's nice and it has many options like limiting the date selection within a period, multiple date selection etc.,
Related
I want to use date picker on my form for selecting date.
I googled for it and found mostly import library scripts from live site. I don't want to use them.They are of limited use and I can't customize them.
Is there any good customizable date picker plugin which I can integrate and customize according my needs
I am working on zend-framework and heared about zendx. Is there any inbuilt date picker which I can call on my form element and how ?
For one of my projects based on Zend Framework, I used the UI jQuery Datepicker. You can find it here: http://jqueryui.com/demos/datepicker/
Another usefull link is this: Zend Framework - JQuery - Date Picker - Format Date to YYYY-mm-dd
You can use Zendx library for make datepicker element. Read this one.
http://framework.zend.com/manual/en/zendx.jquery.view.html
I would like to display vacation and time offs on a linear calendar where the days of the months are the column names and rows are the employee names.
I know there is a way to achieve this using php and javascript but I would like to know if there is a shortcut solution that I can use to implement this quicker.
Use javascript to output a <table>, using something like SortTable or a javascript framework to output it.
Hook up some javascript on the table's click events, and use AJAX to ask PHP for the relevant information. The PHP script can call the database and output the information in something such as JSON.
Without any more specifics in your question I don't think you're going to get much more help.
I am working on form and I am looking for a free calendar/date/timestamp app that i can include in my form. basically, in the input text, i want users to click on the calendar icon and pick a date and a time stamp. that value should populate in the input text.
my next question is, in my mysql db, i am calling this field as "datetime", so i am hoping the values can be written in the db.
i am working with php and mysql.
thanks.
For the user interface you are describing to be added to the input field, jQuery Datepicker springs to mind.
http://jqueryui.com/demos/datepicker/
You'll need to include the jQuery library as well as the jQuery UI library. You can use the 'build your download' link and documentation on the jQuery library page to get a fully themed ui download to suit your design needs.
You'll need to make your form post to a server-side script that will take the field and insert it into the DB. Be careful - mysql date time is in the following format - YYYY-MM-DD HH:mm:SS. You can use strtotime and date to format the input from jQuery. After sanitizing the input, you could do something simple like:
date('Y/m/d H:i:s', strtotime($_POST['date']) )
You can use this to make sure in your server script that the date/time is in the proper format before it goes in the database.
This can be done with GUI
Take a look at jQuery UI Date-picker: http://jqueryui.com/demos/datepicker/
Regards to the date conversion there is plenty of functions to help you
http://www.php.net/manual/en/ref.datetime.php
How can I create a calendar in PHP?
Today should be in bold. How could it be coded?
You can try dhtml Calendar, or maybe Yahoo UI's Calendar.
PHP: date should give you everything you need.
Then, format everything in a table.
Firstly, start by capturing your requirements (should it handle month browsing, should it show a week at a time, etc.) - this should let you derive a functional spec of sorts, which should guide you when actually writing the component/page/application
If you mean: "how to show a date picker on your web page from PHP", the answer is to use some default JavaScript library for it. E.g. Dojo or jQuery.
I just noticed something really nice on the Google Analytics signup page for adding a new domain. First you pick a country them you pick your timezone. Instead of showing a huge Timezone list though they populate the timezone list with only timezones that are available for the country you have selected. I think this is a great idea to make picking a timezone easiar for some users.
So I would like to do this with jQuery since most my other javascript is using jquery already. Has anyone seen any existing jquery script that can do this for me? Or possibly how I can figure out what timezones are in each country?
Can't help with jQuery but for how to figure out what timezones are in each country, you can use DateTimeZone::listIdentifiers() with DateTimeZone::PER_COUNTRY as first argument and the ISO 3166-1 compatible country code as second argument, e.g.
DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, 'GB');
Note: PHP 5.3 is required.
You can construct the data you want from this table: http://www.datelib.de/Timezones.shtml.en. You would simply group by the Country code column. Probably the best way to go would be to throw all this data into a database table and use some AJAX magic to handle select menu onchange events.