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
2
votes
1 answer

Creating a function to fill out a calendar in javascript?

So I want to create a function to get the weekdays in a specified month of year, I can already do this but when I get up to the part where I actually list them on the calendar it seems to start from 0 and go to 30 and not 1 to 31 how it should be…
Braydan
  • 25
  • 6
2
votes
2 answers

Convert Number to DayOfWeek List

I've got an odd issue I'm running into and hoping someone here can help. I'm querying against a Scheduled Task on a Windows computer and getting the days when it is slated to execute. However, where I want to see something like "Sunday, Monday,…
Rick
  • 245
  • 3
  • 13
2
votes
1 answer

Day of week XSD enum

I'm trying to represent a class that, amongst other things, has a set of days of the week - for example, it could be empty, it could be Monday, Wednesday, and Thursday, or could be all seven days. Obviously it shouldn't allow the same day more than…
GeoffM
  • 1,603
  • 5
  • 22
  • 34
2
votes
2 answers

PowerShell Get the Friday 12 Months From This Friday

I'm currently writing a PowerShell script for backup tapes and trying to calculate return dates of the tapes. Tapes are picked up and returned by our provider on Fridays. Retention periods are 4 weeks, 12 months and 3 years. Monthly tapesets fall…
TechFA
  • 129
  • 1
  • 9
2
votes
5 answers

Get the first day of week of a year (any programming language)

How can I get the first day of the week of any given year (day being 1 to 7, or weekday name)? I tried to figure it out in JavaScript, but I accept any other language. I need to select a year to later build the full calendar (I thought using HTML…
alt.126
  • 1,097
  • 1
  • 9
  • 22
2
votes
2 answers

Parse lowercase short weekday to Java 8's time DayOfWeek

I have a string, e.g. "mon" or "tue" or "sun". I want to parse it as a DayOfWeek (or null if not successful). I'm using Kotlin, but i guess the Java folks will also understand what i would like to do: private fun String.parseToDayOfWeek(pattern:…
m.reiter
  • 1,796
  • 2
  • 11
  • 31
2
votes
3 answers

SimpleDateFormat("EEEE") Returns Wrong Day of Week for Timezone

I have the following simple code to get the Day of week according to a timezone. Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone(details.getTimezone())); String dayOfWeek = new…
PWJ
  • 83
  • 10
2
votes
1 answer

Get current week and date of week in react native

I need to display a whole week from Monday To Sunday in following format "Week 2: 05.01 - 11.01" as an example let d = new Date(); let date = d.getDate(); let day = d.getDay(); let currentWeek = Math.ceil((date + 6 - day) / 7); this is what i have…
clockingClock
  • 31
  • 1
  • 3
2
votes
1 answer

Convert datetime column into day of week

I'm trying to convert a datetime type column into day of week with the code below: date = {'Date': ['2018-10-30', '2018-10-30', '2018-10-30', '2018-10-30', '2018-10-30']} df = pd.DataFrame(date) df.Date =…
2
votes
4 answers

Convert integer to a list of week days

I have an integer stored in a database (SQLAgent Frequency Interval) This integer is actually the sum of the selected days of the week that the schedule is to run The possible values are any combination of these values Sunday =1 Monday = 2 Tuesday…
WACM161
  • 1,013
  • 2
  • 9
  • 20
2
votes
3 answers

How to get a weekday name in a given language in Java using Locale and GregorianCalendar?

I am facing some serious difficulties with an exercise where I am to write a simple program which would give a weekday name (not an int value) as an output. What`s more, it should be a weekday 90 days in the future from current date and it should be…
2
votes
1 answer

Java 8: How to parse DayOfWeek with locale set by device

Why is it that whenever I set a DayOfWeek for my TextView the output always appears in capital letters? Also, the day never changes when the language of my device is changed. How can it be set to change based on the device's current locale? …
wbk727
  • 8,017
  • 12
  • 61
  • 125
2
votes
4 answers

How to compare standard DayOfWeek to own with Flag

I have my own DaysOfWeek Flag enum (kind of https://learn.microsoft.com/en-us/previous-versions/ms886541(v=msdn.10)) [Flags] public enum DayOfWeek { Sunday = 0, Monday = 1, Tuesday = 2, Wednesday = 4, Thursday = 8, Friday =…
kenazs
  • 71
  • 10
2
votes
3 answers

sort string array due to DayOfWeek

I have an string array string[] days={ "1", "2", "6" } I want to sort it according to DayOfWeek increasingly. For example "1" is Monday, "2" is Tuesday,"6"is saturday. Today is Thursday. So nearest one is Saturday,Monday,Tuesday. So final array…
mr. pc_coder
  • 16,412
  • 3
  • 32
  • 54
2
votes
2 answers

Date calculator: Tell what day of the week a certain date is

I am trying to write a program in Java (this is a school assignment that tells you what day of the week a certain date is. (The date should be written on the form yyyy-mm-dd.) I thought I had come up with a solution with the code below, but then I…
Eric J
  • 29
  • 2