jquery.mobile: how to ask user for date ranges? - jquery-mobile

I need to ask users of my jquery mobile web site to select a date range.
I can't find any suitable jquery-mobile plugin. I looked for a lot of plugins for date-time picking (the most promising to me being "jQM-DateBox"), but no one seems to allow for a date range.
Any suggestion?

As far as i know there isn't any plugin which provides date ranges until now.
The available date plugins for jQM are
The jQM-Datebox
The MobiScroll
In my opinion the most common way is to use two dateboxes, one for the start date and one for the end date. Initially the end date will be deactivated. The user will select the start date and using the change event you will have to complete the end date with the same date as the selected start date. Afterwards the user will have the option to modify the end date or not.

Im not sure how it works in jQuery Mobile but you could try jQuery UI DateRangePicker (much of jQuery ui is in jQuery Mobile) ...
http://tamble.github.io/jquery-ui-daterangepicker/
Ill be interested to know the outcome.

Related

I want to change the datepicker for my mobile website on iOS

Currently the datepickers trigger the default iOS datepicker with dd-mm-yyyy format. I would like it to trigger the dddd-dd-mm-yyyy format so users are better at picking the correct date because they can see the actual day of the week.
Is this possible for a mobile website?
I'm not sure about doing it for mobile website. But we can change format of default iOS date picker if you want. It's directly not possible through date picker. There is another component called UIPickerView in iOS, through which we can achieve this. Check how to create UIPickerView for mobile website and place the values you want in pickerView.
So after doing more research on the subject I have found that it is possible to use datetime-local. This triggers the native datepicker with ddd-dd-mm format but also accounts for the year (so scrolling over december 31 will make the date object move to the next year). This workaround has issues with IE though, so is not a universal solution.

grails datePicker submit date with timeZone

I am sending date through g:datePicker as Eastern time by default.
How do I have an option where i pass date based on the timeZone selected?
Please help.
Grails datepicker tag does not and should not deal with your timezone. Its just a presentation of date and accepts Date object. Meaning that whatever timezone the date object has it will be that.
There are number of libraries to handle timezone on client side such as ECMAScript Internationalization API, moment.js and many others. On the server side you have libraries such as Joda-time and so on. I am sure if you search on Google you can find plenty more options.
Just handle your timezone conversion, then the presentation layer could be Grails datepicker or bootstrap-datepicker or jquery and etc.

Show date and time together Jquery mobile Datebox

I am using jquerymobile datebox to implement a calendar with time.
http://dev.jtsage.com/jQM-DateBox2/
I was able to set up the calendar successfully and select dates. But I also want to select the time. All the demos just shows how to set up a date picker and time picker separately. And what I want is both together. i.e in one click I should be able to select both the date and time. Any help would be greatly appreciated.
Thanks
It is not possible to do so in the current version 1.1.0. You are welcome to vote on this issue.

Custom input type=date in jquery mobile 1.2.1

I use input type "date" with jquery mobile. But for each device it display different result.
+ Android operating system: choose input date the same type of android calendar
+ iOS: choose input date date the sam type of iOS
+ Desktop: choose input date the same type of operating system install on desktop
I want display dd/MM/yyyy format standard for all device. How to custom format default input date???
Thank you so much!
You can do this, but this is too much of a waste of time and involves cumbersome use of HTML5's localStorage api. For more info, look at this question. In this case also, it's not possible to make type=date behave uniformly in all browsers because each browser handles this differently and you don't have any control over it.
HTML5's standards indicate usage of YYYY-MM-DD format but the browsers sniff your local date format and use that. See this from w3:
The format used "on the wire", i.e. in HTML markup and in form submissions, is intended to be computer-readable and consistent irrespective of the user's locale. Dates, for instance, are always written in the format "YYYY-MM-DD", as in "2003-02-01". Users are not expected to ever see this format.
and this question at jquery Mobile site.
All this must tell you that doing this will take a lot of effort from you. Instead, it would be better if you use some other alternative to this, taken from this question like this : http://jsbin.com/ukelis/1/edit
you could change the dateformat in the altFormat option in the JS and make this work for you. You could also look at this - a mobile version for jquery UI's datepicker.

How to display events in the calendar using Ruby?

I am building a calendaring application in ruby on rails. I am using my own schema for storing events, but I don't know how to display events in calendar, and also how to add a calendar in my application.
Will I have to write code to display calendar or can I use any plugin to display calendar.
I think the calendar_helper plugin is what you want. It provides a calendar method to your views, which can be called to generate a month-view calendar in HTML.
You can pass it a block which builds the contents of each day's cell, which is where you would want to do whatever your event schema requires to pull in the day's events.
The EventCalendar plugin was created for this very reason. Easily show multiple, overlapping events across calendar days and rows.
http://github.com/elevation/event_calendar
Screenshot(s) at: http://dev.elevationblog.com/2009/7/23/event-calendar-rails-plugin
There's a little list of candidates here.
The plugin on the page itself seems to offer some AJAX goodness, if that's something you're interested in.
I also had to build a calendar in rails. None of the existing calendar gems appealed to me as they did too much. I wanted to render the calendar myself so I could control the styling. I also had an existing Event model so I didn't need any kind of event handling. I ended up creating the cal gem. It's pretty straightforward when you look at the README. I plan to improve it to have weekly and daily calendars. Good luck!

Resources