I have a RoR app using Fullcalendar - running on Heroku.
The calendar view shows an event as 9am - 10am. When I view a list of the time, I get 4p - 7pm.
Does it has something to do with timezone?
I tried setting ignoreTimeZone true and then false:
$(document).ready ->
$('#calendar').fullCalendar
editable: true,
ignoreTimezone: true,
header:
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
defaultView: 'month',
height: 500,
slotMinutes: 30,
Thanks for the help!
Here is an example - the database record has start_at 16:00 (4pm) but the Fullcallendar view shows it starting at 9am
Your events list (index.html.erb or the like) shows UTC times while fullcalendar shows times in your browser's detected timezone.
In order to fix this, you should set the timezone of each request thread to the user's timezone. This should work:
In your events controller, add this:
before_filter set_time_zone
def set_time_zone
(...)
end
Checkout the rest of the code in this post:
https://stackoverflow.com/a/942865/336806
There's also this neat gem that I'm using myself:
https://github.com/scottwater/detect_timezone_rails
The following fixed the problem:
$ heroku config:add TZ=America/Denver
Related
So I know there are plenty of threads and I've gone through the official documentation and tried the options laid out here, but this Datepicker is my mortal enemy and it simply never does what I, in any way, seek to do:
Currently (and for whatever reason) only future dates can be picked. I, on the other hand, want only dates that are longer than 21 years in the past to be pickable. Along with everything in the past. In fact, just having any dates in the past enabled would already help.
This is what I have at the moment - and to my surprise the DateFormat works - and in general Dates get saved.
$('.datepicker').datepicker({
format: 'dd/mm/yyyy'
endDate: '+0d',
autoclose: true
});
Working with this gem.
With every project no matter how complex or simple, this is the only problem I am having. Always, and ever :).
$('.datepicker').datepicker({
format: 'dd/mm/yyyy'
startDate: '-Infinity',
endDate: '-21y',
autoclose: true
});
I have form, I want to show time when I pick it, but It show date and time
enter image description here
I want to remove it, cause no sense
My coffee:
$('#time1').datetimepicker
format: 'hh:ii'
autoclose: true
startView: 1
My slim:
#time1.input-group.date
input.form-control type="text"
span.input-group-addon
span.glyphicon.glyphicon-time
Pls help me T_T
# In your cofee it can be like this
$('#time1').datetimepicker
pickDate: false
format: 'LT'
I'm using Kendo UI MVC DateTimePicker. By Default, the time shows as a list:
12:00AM
12:30AM
...
11:30PM
12:00PM
Is it possible to customize this list? The work schedule is for 8:00AM - 4:00PM. It makes more sense to have the list start from 8AM to 4PM.
Could not find any info/question about this.
Thanks
*** I'm using the DateTimePicker in the schedule template. It maps to model.start in the model. So, have to use a DateTimePicker
You cannot with DateTimePicker. However, you can have both DatePicker and TimePicker together, and restrict time range.
Documentation
#(Html.Kendo().DatePicker()
.Name("StartDate"))
#(Html.Kendo().TimePicker()
.Name("StartTime")
.Min("8:00 AM")
.Max("4:00 PM"))
got answer from Kendo support:
You can use the "edit" event of the Scheduler to update the options of the dateTimePickers inside the editor. Demo is at http://dojo.telerik.com/UzicU/2
edit: function(e) {
e.container.find("[data-role=datetimepicker]").each(function() {
var dtp = $(this).getKendoDateTimePicker();
dtp.timeView.setOptions({
min: new Date(2011, 1, 1, 8, 0, 0),
max: new Date(2011, 1, 1, 16, 0, 0)
});
});
},
Hope it helps.
I'm using fullcalendar with timezone option set to to local. One of events fetched from server looks file follows.
{
allDay: true
className: "term"
end: 1425949200000
id: "5519341d300416ba3b825a65"
rendering: "background"
start: 1424629800000
title: "Term 1"
}
the end date when converted to a date object is Tue Mar 10 2015 06:30:00 GMT+0530 (IST). But the calendar when rendered shows the event only till 9th of March. I'm not sure whether it is visible in screenshot since it is a background event(light colour). I'm accessing from the same timezone so what is happening here?
I am using Grails with extJS in my project. I have a date column in my display page. It gets displayed as 2010-09-29T04:00:00Z.
After i used the below to render the date, I got the date displayed as NaN/NaN/NaN
{header: "Date", width: 90, renderer : ('m/d/Y'), sortable:true, dataIndex: 'date'}
Am I missing something here?
Thanks!
Try adding the following function to your code:
function RENDER_date(value){return value ? value.dateFormat('m/d/Y') : '';}
Then set the renderer property:
renderer: RENDER_date
Thanks Ergo/Chau. It seems that some work only for Firefox and not for IE7. The code mentioned in my query works with Firefox and I get the right output. However, with IE7 it doesn't. Had to make the below change for it to work in IE7.
{name: 'dte', dateFormat:'c', type:'date'},
and in ColumnModel:
{header: "Date", width: 90, dataIndex: 'dte',
renderer : Ext.util.Format.dateRenderer('m-d-Y')
},
Add to format: 'm/d/Y' to your grid and store config.