Print Page | Close Window

Retrieve WeekNumer from control?

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=5351
Printed Date: 22 November 2024 at 8:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Retrieve WeekNumer from control?
Posted By: celebre
Subject: Retrieve WeekNumer from control?
Date Posted: 24 October 2006 at 9:40am
My application prints events given a week number, but it will depend of the DatePicker.FirstWeekOfYearDays value.
I can code a function to read that property and calculate the week number... but If the control calculated it previosly I think that is redundant.
 
Can I retrive the weeknumber from the control directly? Can't find any method in the help.
 
Greetings



Replies:
Posted By: sserge
Date Posted: 24 October 2006 at 5:02pm
No, you can't.  Use the folowing simple formula:

WeekNumber = ((LastWeekDay.Date - (DatePicker.FirstWeekOfYearDays - 1)).DayOfYear - 1) / 7 + 1


--
WBR,
Serge


Posted By: celebre
Date Posted: 24 October 2006 at 6:31pm
Ok, thx for the tip



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net