Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calendar with Week numbers
Message
From
22/01/2008 09:20:50
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01283961
Message ID:
01283972
Views:
15
>Hello,
>
>Is there any control which would help to choose week of the year.
>Something similar to ole calendar control?
>
>Thanks in advance

I don't know of anything ready-made, but you could populate a ComboBox with texts similar to:
01 - Jan. 3-Jan. 9
02 - Jan.10-Jan 16
...
Or whatever is appropriate for the year you are considering.

Also, how are you going to store the information, whatever the user selected?

At Bata/Bolivia, I stored the week as a date, the starting date of the week. A Monday, since that's the way the company calculated its weeks (it seems to be more standard, all over the World, for weeks to start with Sunday).

For selecting the week, I made some adaptations to the date picker provided by the framework. As a result, the user can type in the week as a date, select the date from a calendar, or type in the week code (for example, "803" means 2008, week 3), in a separate TextBox I provided. Because of the way users are accustomed to work, they usually choose this last alternative.

When the user selects a date that is NOT a Monday, the date is automatically adjusted to the previous Monday, and the user received notification through WAIT WINDOW.

The same class is also used to select dates. The programmer chooses, through a property, whether to select a date or a week. In this case, the week code becomes a date code, for example, 8032 (year 2008, week 3, Tuesday, since our weeks start with Monday).

To define the weeks, I wasn't sure whether our company used any standard definition, so we store the first day of the year (day 1 of week 1) in a table, and this table is used to convert to and fro.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform