-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Get the current timestimp in each day in the week #185
Comments
You can dump anything from your json data into each template. If you were using the example data which provides "start": 12039485678000, // Milliseconds you could spit that out using <%= event['start'] %> but you'll probably want to format it inline using something like this.. var date = new Date(<%= event['start'] %>);
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var formattedTime = hours + ':' + minutes + ':' + seconds; |
thx stokes84 , but I want the current day, not the event start day, For exemple, in 2 / 12/ 2003 and i have an event from 10:00 to 11:00 => i want to get "2" ( the number of day) :) |
the method above will work, use date.getDay();, year, month, day, they're all in the starttime and endtime just have to parse em out. If you're using php to generate your json you could also add another field and pull that instead of generating a javascript function every loop iteration to spit out a day. |
thx @stokes84 ans sorry for the bad example above : i want to get the number for the current day in case when i have an event between tow days: from |
Then you will need to do this in PHP date("w", strtotime($DATE); This will return the current day. Not entirely sure of what you are asking though. |
Would it be possible to subtract start from end?
|
thx @steliosph and @steliosph, but that is not what i need. So i reformulate the situation. There is a way to get the value of each week days from In week-days.html template (week 5 of 2014):
|
I did not not get you. |
thx @Serhioromano, i made some updates in the example above. i hope that's become clear now. |
But you have https://github.com/Serhioromano/bootstrap-calendar/blob/master/js/app.js#L25 Anyway you can see how to create title in that exact method https://github.com/Serhioromano/bootstrap-calendar/blob/master/js/calendar.js#L789-806 |
thx, but i'm not interested with |
HI, In
week-days.html
template, for each iteration can we get the corresponding timestamp or day ? (i can't find a way to dump 'events' an underscore variable)The text was updated successfully, but these errors were encountered: