Questions tagged [dayofweek]

Usually a function that returns day of the week when a certain date object is passed.

Get day of day of the week in:

691 questions
5
votes
1 answer

Only Select Friday and coming Monday in mysql

I have assignment on my hand of building an Attendance system which I am doing all right but I am stuck at one place. When counting the leaves, if a person takes a leave on Friday and then take leave again on Monday, then the in between Saturday and…
awatan
  • 1,182
  • 15
  • 33
4
votes
2 answers

Objective-c get day of week in number starting with Monday, NOT Sunday

I'm making my custom calendar view for an app for the European market. In a function I should get number of day of week... I do, but it returns the number of the day of week starting with Sunday. How should I hardcode returning this number starting…
Vladimir Stazhilov
  • 1,956
  • 4
  • 31
  • 63
4
votes
2 answers

Algorithm to find continuous days in a week

The user can select any number of week days from a list. An algorithm shall find the longest continuous group of selected days. The start day can be after the end day, if the group spans two weeks. If it makes it simpler, only a group of at least 3…
ygoe
  • 18,655
  • 23
  • 113
  • 210
4
votes
4 answers

How to get List of DayOfWeek from between two DayOfWeeks

I want to get the list of DayOfWeeks, between two DayOfWeeks. For example, Input1: DayOfWeek.MONDAY Input2: DayOfWeek.WEDNESDAY And output should be list [DayOfWeek.MONDAY, DayOfWeek.TUESDAY, DayOfWeek.WEDNESDAY] Is Java providing any Api to…
Remo
  • 534
  • 7
  • 26
4
votes
2 answers

Adjust Date to match saved day of week

I have a table that stores a StartDate and the name of the day of week that start date falls on. I don't know why, it is bad design but I didn't create it and can't change it. So of course, now we have some dates that don't match the day of week. To…
xr280xr
  • 12,621
  • 7
  • 81
  • 125
4
votes
2 answers

How to truncate a date to the beginning of week (Sunday)?

I need to truncate dates to the start of week, which is Sunday in my case. How can I do this in PostgreSQL? This truncates to Monday: date_trunc('week', mydate)
planetp
  • 14,248
  • 20
  • 86
  • 160
4
votes
2 answers

Calendar#getFirstDayOfWeek() returns wrong value

I might be overlooking something incredible obvious, but why does this: final Calendar calendar = Calendar.getInstance(Locale.GERMAN); System.out.println(calendar.getFirstDayOfWeek()); Result in 1 (Sunday) instead of 2 (Monday) ? And before…
Stefan S.
  • 3,950
  • 5
  • 25
  • 77
4
votes
9 answers

Javascript get weekdays between two specific weekdays

How can I get all weekday names between 2 weekdays as parameters? It should also return accurately when it get past the 7 days. My week format is: 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' Example and…
marknt15
  • 5,047
  • 14
  • 59
  • 67
4
votes
4 answers

Java 8 LocalDate: Determine What Monday of the Month its (1st, 2nd, 3rd, etc)

I'm trying to figure out how to determine whether a particular Monday is the first, second, third or fourth Monday of a given month. I've figured out how to get the next Monday and the Week of the of month that resides in using the LocalDate…
Joseph Freeman
  • 1,644
  • 4
  • 24
  • 43
4
votes
2 answers

Get first three characters from DayOfWeek , Month

I've a datetime: DateTime dt = new DateTime(2003, 5, 1); dt.DayOfWeek // returns Thursday How I can split only first three characters from DayOfWeek e.g. Thu?
user1773603
4
votes
1 answer

fparsec OperatorPrecedenceParser : How to deal with incomplete parentheses

This code will read this input "(WEEKEND-SUNDAY)" and then return "SATURDAY" but input "WEEKEND-SUNDAY)" still return "SATURDAY" => this parser ignore last ')' let pDayOfWeekKeyWords = choice [ pstring "MONDAY" ; …
user6826023
4
votes
6 answers

Javascript OR operator not working in if statement

I'm trying to get this Javascript to do something if the day of the week matches any of the days listed in my statement, as well as restricting it to between 17:00 and 19:00 hours, but the OR operator is not working as I expected, I'm new to JS and…
Sam Assoum
  • 437
  • 1
  • 8
  • 21
4
votes
4 answers

Adding one week via java.util.Calendar.add() fails

I'm trying to iterate in my Java program over all weeks between two dates (the end date being today). First, I get the starting date: Calendar start = Calendar.getInstance(); start = data.getFirstDate(users, threads); So far, so good. The start…
Julian
  • 408
  • 5
  • 16
4
votes
3 answers

Name of day of week in italian language in c#

I can't to extract the name of day of week in italian language in my aspx page with c#. I have tried this solution but in the output I have Friday, what wrong? DateTime ItalianJobCookie = DateTime.Parse(Request.Cookies["ItalianJob"].Value); string…
Antonio Mailtraq
  • 1,397
  • 5
  • 34
  • 82
4
votes
3 answers

How to get very short week day names in Android like Google Calendar app

I am finding a solution to get very short week day names like Google Calendar App. The below is what I tried: String[] shortWeekDays = DateFormatSymbols.getInstance(Locale.getDefault()).getShortWeekdays(); The result is Sun, Mon, Tue, Wed, Thu,…
LHA
  • 9,398
  • 8
  • 46
  • 85