I'm building a timesheet app for employees and would like the employees to 
be able to select a day of the week date based on what the date was on 
Monday.

ie. the user inputs the Monday date of the timesheet, then for each row 
they need to fill out they can select the Day/Date for each day that week 
so that those hours they input get assigned to that specific day/date. The 
easiest way I can think of would be to make a list of choices in the Model 
such as ...

MONDAY = 'MO'
TUESDAY = 'TU'
WEDNESDAY = 'WE'
THURSDAY = 'TH'
FRIDAY = 'FR'
SATURDAY = 'SA'
SUNDAY = 'SU'

DAY_CHOICES = (
    (MONDAY, 'Monday'),
    (TUESDAY, 'Tuesday'),
    (WEDNESDAY, 'Wednesday'),
    (THURSDAY, 'Thursday'),
        (FRIDAY, 'Friday'),
        (SATURDAY, 'Saturday'),
        (SUNDAY, 'Sunday'),
)
day = models.CharField(
    max_length=2,
    choices=DAY_CHOICES,
    default=MONDAY,
)

This would work except I also want to include the actual date of the day 
they select, based on the Monday date that they put in in another Model

Is there a library or package I can use to do this? 

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6089eafa-7495-4ec4-a539-624cf95014b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to