I can do new moment().week() to get the week number for the current day.
When the current day is a Sunday/Monday which can be set as first day of week by my user, how can I do something like this to get the week index with momentJS:
new moment().firstDayOfWeek(1).week() // monday
OR
new moment().firstDayOfWeek('monday').week();
I do not want to load or change a locale setting via including .js files...
My user can sit in the United States where first day of week is seen as Sunday.
But my user is from Europe so he wants to have European calendar settings where a week starts on Monday.
Related
Usually you can get this using LAST_DAY in esql but in app connect it's not working anyone has any idea on how to get last day of the month using esql in app connect?
I solved the problem I used intervals to get the next month then set the next month's date value to 1 and use interval again to get the day before, which will be the last date of the month in question.
Basically I checked the next month and got next month's 1st date which will always be 1 then got the day before that which will always be the last date of current month.
Can fullcalendar be able to cache the events data of months view when we navigate from one month to other month view(Prev and Next buttons) as like lazyfetching caches data with in the single month when we navigate to week or day view as it only works for a single month. Say I am on Feb month and then change to the day view, the data is cached and does not send an ajax request. But If I change months to March and back to Feb, Feb still reloads.
I want to know when is the New Month. So that I can do some operation
like, copy last month data [eg. Category.Title] from last month [Jan] to the new month [Feb].
Month Catagory
===== ========
Jan => Category.Title
Feb => New Category.Tile (copy based on Jan's data)
How do I construct the logic to detect that Today is a new month (so that I can preform the copy operation)?
Basically, I want to detect when is the New Month begin?
If all you need is the logic to check if today is the first day in a month, you can use the following code.
var d:Date = new Date();
if (d.date == 1) {
//today is the first day in a month
}
Depending on where/when you're doing this however, it may not have the effect you desire. Without more information, I can't really help you there.
You should employ this fabulous logic found on the provided link and go from there. Pretty much you need to find out if current date of the month. Lets say if today is the 15th of April, you will then need to find out how many days are there in April, 2012, and where does the 15th of April fall. And then have a counter count the remaining days until the new month (May) begins. You also want to make sure that you are checking for the leap year. This link also has a function that checks for the leap year. I am giving you a high level idea to go about getting what you trying to.
http://www.electrictoolbox.com/javascript-days-in-month/
Thanks a lot.
i have four forms namely file status , load file, reconciliation, and reports.
Reconciliation form has 2list boxes.. namely fiscal year and fiscal month. In that we have to choose for eg say i chose fiscal year 2012 and month as 1, then when i click open the reports form i have reports in there which displays information as per the year and the month.
what my requirement is in this report it displays fiscal year as i have chosen in the first step. But i do not want it because fiscal year 2012 and fiscal month 1 actually corresponds to actual year 2011 and month 10 i . e October. i want this to be displayed over there.
IF the corresponding Calendar Month/Year is always the same period behind, then a simple calculation could be done:
Format(DateAdd("M",-3,Format([FiscalPeriod]&"-01","ddddd")),"MMMM YYYY")
-OR-
Format(DateAdd("M",-3,Format([FiscalYear]&"-"&[FiscalMonth]&"-01","ddddd")),"MMMM YYYY")
If it's not, then You'll need a lookup table for each Fiscal Period and it's related calendar Month. Then have that value looked up on Your form using Dlookup() and have the report reference the lookup field instead of the List Boxes.
From the Access Help files:
DLookup(expr, domain [, criteria] )
Sample:
=DLookup("[ProductName]", "Products", "[ProductID] =" & Forms![Order Details]!ProductID)
I have a need to use the FullCalendar plugin's month view, but with a small twist... I need the month view to be a calendar month (4 weeks) from the currently selected date, not a month proper (Jan, Feb, etc). In other words, I need the top left column to be the currently selected date, with the calendar rendering 4 weeks after that in month view.
Something similar to what is provided by thefirstDay property in agendaWeek view is close to what I am after. firstDay only sets the day of the week though, not a specific date within the month as the first day.
Try
firstDay: new Date().getDay()
in the parameters.
If you're going to show a Thursday in the upper left hand corner then what you've got isn't a calendar. It's a table data.
FullCalendar's firstDay is just for switching between starting on a Monday (European style) and starting on a Sunday (US style).