My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 44: formatDate "w" variable for week number
12 people starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Merged:  issue 295
Owner:  ----
Closed:  Mar 2013


Sign in to add a comment
 
Reported by mfcanova...@gmail.com, Jun 23, 2009
Is there a possibility to show week number in the calendar?

Is there any way to drop an event from a table or a grid?


Thanks for all!

Jun 28, 2009
Project Member #1 adamrs...@gmail.com
it is currently not possible to display a week number, and i don't plan to implement
this feature unless more people request it.

to drop (remove?) an event from the current month, you can use the
.fullCalendar('removeEvent', eventOrId) function. docs are located here:
http://arshaw.com/fullcalendar/docs/#calevent-objects. does this answer your question?
Status: Done
Jan 26, 2010
#2 r.krewin...@innervate.nl
Hi Guys, 

I got the solution for the weeknumber!
I've took the liberty to modify the code in fullcalender.js, browse to line: 2937
I've added a dateFormat called "W" with a function to calculate the weeknumber.
You can use it in a format string as - you guess - "W"
example: 
titleFormat: {
 month: 'MMMM yyyy',                                 // December 2009
 week: "d[ MMM][ yyyy]{ 't/m' d MMM yyyy}, week W",  // 27 Dec 2009 t/m 2 Jan 2010,
week 52
 day: 'dddd, d MMM yyyy'                             // Wednesday, 30 Dec 2009
}

it's not minified yet, 
have fun!!

Rene
fullcalendar.js
81.5 KB   View   Download
Feb 5, 2010
Project Member #3 adamrs...@gmail.com
nice work. the W variable is something i should add into a release
Feb 6, 2010
Project Member #4 adamrs...@gmail.com
here is a new issue dealing w/ making it an actual column on the left:
https://code.google.com/p/fullcalendar/issues/detail?id=295
Feb 26, 2010
Project Member #5 adamrs...@gmail.com
(No comment was entered for this change.)
Summary: formatDate "w" variable for week number
Status: Accepted
Labels: -Type-Defect -Priority-Medium Type-Enhancement
Mar 15, 2010
Project Member #6 adamrs...@gmail.com
 Issue 381  has been merged into this issue.
Jun 20, 2011
#7 roundc...@gmail.com
Please find attached a patch to add this W format. The week number determination function is borrowed from jquery UI datepicker.
fullcalendar-weeknumber.diff
790 bytes   View   Download
Sep 16, 2011
#8 karel.ro...@gmail.com
how comes week W does not show the number of the week, but only the character W?
Thanks to help me
kr-design.be/agenda.html
+ I also search for a google-'change+save only description-text' and view the description with <br/> breaklines.
Karel
Dec 13, 2011
#9 ds.rach...@gmail.com
I would install in to my new web http://cheapunder.com and http://gaminglaptops.cheapunder.com
Feb 23, 2012
#10 unsec...@gmail.com
after implementation from 'fullcalendar-weeknumber.diff ' at ver.1.5.3 I receive an error => request an object , line 1590, code:0. Better test it. The first solution working ok. thnks. PS. Why it's att into v. 1.5.3 not yet? It's so useful ...

Apr 13, 2012
#11 viesr...@gmail.com
Please, please implement this into a next version of fullcalendar, cause it's really needed in most european countries. 
Jul 6, 2012
#12 kay.haeu...@gmail.com
diff -Naur arshaw-fullcalendar-38ef267.orig/src/date_util.js arshaw-fullcalendar-38ef267/src/date_util.js
--- arshaw-fullcalendar-38ef267.orig/src/date_util.js   2012-02-06 22:40:40.000000000 +0100
+++ arshaw-fullcalendar-38ef267/src/date_util.js        2012-07-07 00:56:10.248635448 +0200
@@ -322,6 +322,17 @@
        return res;
 };
 
+// Determine the week of the year based on the ISO 8601 definition.
+// copied from jquery UI Datepicker
+var iso8601Week = function(date) {
+       var checkDate = cloneDate(date);
+       // Find Thursday of this week starting on Monday
+       checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
+       var time = checkDate.getTime();
+       checkDate.setMonth(0); // Compare with Jan 1
+       checkDate.setDate(1);
+       return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1;
+};
 
 var dateFormatters = {
        s       : function(d)   { return d.getSeconds() },
@@ -353,6 +364,9 @@
                        return 'th';
                }
                return ['st', 'nd', 'rd'][date%10-1] || 'th';
+       },
+       W       : function(d)   {
+               return iso8601Week(d);
        }
 };


and make
Jul 6, 2012
#14 kay.haeu...@gmail.com
how can i attach an attachment?
Jul 29, 2012
#15 kay.haeu...@gmail.com
save the file[1] to /tmp

cd /tmp;
git clone git://github.com/arshaw/fullcalendar.git;
cd fullcalendar;
patch -p1 < ../fullcalendar-week.patch;
make;
ls -lA build/fullcalendar/fullcalendar/ dist;

[1] https://docs.google.com/open?id=0B9q1BdaqymGaT0pTWmt5ZmMyOWs
Aug 20, 2012
#16 schniede...@gmail.com
any ways to implement the week numbers into the Solgema.Fullcalendar ? 
Feb 20, 2013
#17 r...@team.ksz.ch
I like the iso8601Week function, works like a charm.
What i don't like is the 'W' as trigger char, better to use 'WN', otherwise i cant have a String like "Woche: x".
Thanks and greetings.
Phil
Mar 2, 2013
Project Member #18 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Duplicate
Mergedinto: 295
Sign in to add a comment

Powered by Google Project Hosting