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
Related
I have two types of date time fields in my database. DATE and TIME. With the DATE field Grocerycrud gives you a date picker when adding a record. With the TIME field Grocerycrud only gives you a text field.
Is there any way to get Grocerycrud to show a time picker for TIME fields?
Use a datetime field instead and you'll get the datepicker and timepicker altogether.
If you wish to use only time fields you'll have to modify GC. This is not the correct way to extend GC but as development seems stopped I guess its ok.
Follow the instrucction from this post:
http://www.grocerycrud.com/forums/topic/1573-timepicker-implementation/#entry11462
After a long search and following through the above documentation which didn't work for me I devised my own solution. Convert the type of input field to time using jquery. It was sufficient for me although its not a robust method. It may help in certain situations at least
<script type="text/javascript">
$( document ).ready(function() {
var a = document.getElementById("field-ScheduledTime");
a.type="time";
});
</script>
I need a date picker/selector written in php, jquery and probably mysql that is visible for the user to select a particular date and view the contents for that particular date.
An example can be found here
http://soccernet.espn.go.com/scores/_/league/eng.1/english-premier-league?cc=3888
Another example is http://www1.skysports.com/football/fixtures-results/06-september-2012.
You can use the JQuery UI Datepicker and modify it for your own purposes. There a lot of Date Pickers out there. In this case, Google will probably provide you with more answers than Stack Overflow :)
by using form and post method in my program. It seems like my values of calendar are not able to insert into my database. I'm using jquery's datepicker and php to code. Please advice. Thanks
chances are your database is structured with a date format or datetime format. This is fine, but you will have to change the format of the date in the jquery UI after it is posted. Therefore if you have it as 12/19/2010 it would have to be changed to 2010-12-19 for the database to accept it. This is just a random guess since I don't know much more from your question.
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.
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.,