well I know how to get current day of week it's getDay, right... and also there is getUTCDay option to get current day of week for universal time. Now, what I need is to get current time for UTC+1, because I need to make IF statement which checks current UTC+1 Day, and do something based on which day it is.
So in short... if I need getUTC+1Day )) how could I do that?
I made a custom function for returning the current week of the month and it is having problems with months that have more than 5 weeks such as May and August. It is returning the week before the current week, such as May 25 is really week 5 but it returns week 4.
I am using the following script to have a calander displayed in my form. It displays a calender on which a user can select a date. If the date is a friday, something else should happen in the form than when selecting other days (see final 15 lines, no need to be specific).
The problem is that the code only works for months with 30 days in it. E.g. The september month works fine, when a friday is selected (javascript:setCalendarControlDate(2009,9,25)) the correct changes occur. For the October month (31 days) the same changes that occur correct in september occur in october when selecting thursday, but these should be when selecting friday instead! For November (30 days) everything works fine again, but then for December (31 days) the changes occur again at thursday instead of friday For February (2010) I need to select sunday to get the needed changes.
Like I said, I think it has something to do with the amount of days in a month. Since the code works fine on months with 30 days, but not on months with other amounts of days. Can anyone tell me what's wrong in the code?
function positionInfo(object) {var p_elm = object; this.getElementLeft = getElementLeft; function getElementLeft() {var x = 0; var elm; if(typeof(p_elm) == "object") [Code].....
I want to be able to pass in any given date and return the week of month that it lies within. Weeks will start on Monday. Also if Day 1 and 2 are saturday and Sunday, those should be labeled as week 1.
var fullDayName = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday")
function verify(isField){
var splitDate = isField.value.split("/"); var refDate = new Date(isField.value); if (splitDate[0] < 1 || splitDate[0] > 12 || refDate.getDate() != splitDate[1] || splitDate[2].length != 4 || (!/^19|20/.test(splitDate[2]))){return false} return refDate; }
function calcDay(isForm){
var startDate = verify(isForm.nStart); var n = 0; if (startDate) { var offset = isForm.nOffset.value; if (offset > 0) { for (i=1; n<offset; i++) { var tmp = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()+i); if (tmp.getDay() != 0 && tmp.getDay() != 6){n++} } i--; } else { for (i=1; n>offset; i++) { var tmp = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()-i); if (tmp.getDay() != 0 && tmp.getDay() != 6){n--} } i = (i*-1)+1; } var resultDate = new Date(startDate.getFullYear(),startDate.getMonth(),startDate.getDate()+i); var slashDate = resultDate.getMonth()+1+"/"+resultDate.getDate()+"/"+resultDate.getFullYear(); isForm.nResult.value = slashDate; isForm.dayName.value = fullDayName[resultDate.getDay()]; } if (!startDate) { alert('Invalid Date') isForm.nStart.value = ""; isForm.nStart.focus(); } }
I have a marquee in my site and and I have 7 corresponding html pages for 7 days of the week. I would like to have a day detection so (e.g) saturday.html will go in my iframe on my hompage ...
I am using the following to create a date..Code:var the_date = new Date(dateText);The date format I use is dd/mm/yyyy, is there a way to add 1 week to the date?
Throughout the world in general, ISO 8601 Week Numbers are used, in which weeks are numbered 01 upwards and Week 01 contains the first Thursday of the Gregorian Calendar Year.
There are, however, odd parts of the world where that standard is not followed.
Ignoring for the moment cases in which week 1 is not more-or-less at the beginning of the calendar year, what other definitions, stated exactly, are used?
when the page loads I want to display both the div content and highlight the tab for the current day. I've found some code that loads the correct div based on the day but doesn't change the tab that's highlighted:
I want to get the day number of the week from a dynamic date such as 2010-09-25. The Objects to use are clear but not the input they accept var d=new Date(); var dd=d.getDay(); But this retaurn the week day number of the current day. So how can I feed Date() with above date?
I'd like to put a script on the home page of one of my sites that automatically rotates content for a specific day of the week.
You can see the site HERE.
I'd like to take the first story in the NEWS & EVENTS section and make it change with each day of the week to match the corresponding stories in THIS PAGE.
I'd like to do this all with Javascript rather than server-side includes. Unfortunately, I know very little Javascript.
I need a javascript function that returns the Saturday of the week for a given week day. Example if I input 2/5/2010 I get 2/6/2010 or if I put 2/10/2010 I get 2/13/2010
I have a fromDate and a toDate input box both populated using thedate picker. For thedefault Datehow can i specify it so it always uses last week starting fromSaturdayand going toSunday and not the current date or a fixed date?
I'm trying to implement this Plugin:[URL]...$(”#calendar”).weekCalendar(”gotoWeek”, date); // Go to the week that the date passed falls within But it don't want to work for me. I have tried with several date formats like:
I am developping an interface that allows to manage bookings for a selected week. You can add, delete, view a booking. When you open a client's booking, I could fetch the id from some div, call an ajax request, and load the booking's data in some dialog (client's data, booking info (date, hour, description, ..)). I don't wish to forward the manager to another page (another request).
But another option, would be to load all the client's data of the selected week (may be up to 100) into a hidden div, and when the manager wants to view a booking, I may just fetch the data from that hidden div. It's much faster, there's no ajax. However, the problems is that there will be a lot of HTML, and I guess the page will be slower to parse; I need a (very) fast page rendering (it's already pretty loaded as it's an application). A solution would be to load asynchronously that data in the hidden div, so the page may render fast, but I don't know how to achieve this. No server request (ajax) is needed as I have the data, but don't want to put it directly into the page, it will slow it down, but to insert the data after the page rendering. Like an ajax without server request ...
I want to be able to pass in any given date and return the week of month that it lies within. Weeks will start on Monday. Also if Day 1 and 2 are saturday and Sunday, those should be labeled as week 1.
We're using the Datepicker plugin, and it works great. We don't have any text input field tied to it, instead we have associated our own js-function with the onSelect attribute. But now the client wants to be able to click on the week number, or the month and then do something based on that. Preferably some onSelect function, just like when a user selects a specific day. Is this possible?
A very simplistic example of what I would want to be able to do, all with one single datepicker instance [code]...
1. Take the current URL of the page and open a new window with a URL based on the current page. Some examples (I use "->" to mean "this URL turns into that URL"):I plan to use these bookmarklets in sequence, first pressing 1 to log into the CMS, then pressing 2 to edit the current page.