I couldn’t find it so I assume it is not there but…
Can we have a date.getWeek() function (based on the locale)?
I couldn’t find it so I assume it is not there but…
Can we have a date.getWeek() function (based on the locale)?
added to req feature list.
For the time being you can do following
//credits
//http://www.codeproject.com/csharp/gregorianwknum.asp
var year = arguments[0]
var month = arguments[1]
var day = arguments[2]
//lets calc weeknumber the cruel and hard way
//Find JulianDay
month += 1; //use 1-12
var a = Math.floor((14-(month))/12);
var y = year+4800-a;
var m = (month)+(12a)-3;
var jd = day + Math.floor(((153m)+2)/5) +
(365y) + Math.floor(y/4) - Math.floor(y/100) +
Math.floor(y/400) - 32045; // (gregorian calendar)
//var jd = (day+1)+Math.Round(((153m)+2)/5)+(365+y) +
// Math.round(y/4)-32083; // (julian calendar)
3)How to get weeknr from within another script
var myWeekNr = globals.getWeekOfYear(‘2003’,‘8’,‘15’) //year - month - day
Wow thank you Maarten, this saves me ‘some’ time
i think this is a bit more easier:
var week = parseInt(utils.dateFormat(new Date(), ‘w’));
Wow, so simple and so powerfull…
Thanks!
ahumm..
I overlooked this option.
Our dev team is stuffing Servoy with so much features,
it’s their fault.
That’s why I have so many questions …
Or is it my brain, only limited to remembering a certain number of options