Questions tagged [date-range]

Date-range refers to a range of dates, i.e. a period of time between a start date and an end date.

Date-range refers to a range of dates, i.e. a period of time between a start date and an end date.

Date range is commonly used:

  • as search criterion for any date related data,
  • when operating on data referring to periods of time.
1608 questions
5
votes
5 answers

How to prevent user from selecting date above end date in react-dates

I'm wondering how I could prevent a user from selecting dates above today's date. For example, today is 3.7 so let that be the highest end date a user could select.
Roxy'Pro
  • 4,216
  • 9
  • 40
  • 102
5
votes
1 answer

in daterangepicker how can i set minDate Dynamically?

I have two date input one with start date and other is an end date. I want to set minDate Dynamically to end date input based on start date. In short, I want to prevent a user from selecting end date less than start date (on change of start date I…
Jigar
  • 3,055
  • 1
  • 32
  • 51
5
votes
1 answer

Generating monthly timestamps between two dates in pyspark dataframe

I have some DataFrame with "date" column and I'm trying to generate a new DataFrame with all monthly timestamps between the min and max date from the "date" column. One of the solution is below: month_step = 31*60*60*24 min_date, max_date =…
LDropl
  • 846
  • 3
  • 9
  • 25
5
votes
3 answers

Split date range into several chunks ending by YYYY-12-31

df <- data.frame(group = c("a", "a", "b", "b"), start = c("2017-05-01", "2019-04-03", "2011-03-03", "2014-05-07"), end = c("2018-09-01", "2020-04-03", "2012-05-03", "2016-04-02")) Let's say I have the following…
arg0naut91
  • 14,574
  • 2
  • 17
  • 38
5
votes
4 answers

Algorithm to combine / merge date ranges

I am trying to find the best way on how to merge date ranges into one database record (array element). This is the data I have: Array ( [0] => Array ( [id] => 18298 [start_date] => 2011-07-09 …
Kelvin
  • 8,813
  • 11
  • 38
  • 36
5
votes
5 answers

c# check if a timespan range is between timespan range and how many hours

Assuming I have 3 time ranges: 07:00 - 18:00 18:00 - 23:00 23:00 - 07:00 and the code: public class TimeShift { public TimeSpan Start { get; set; } public TimeSpan End { get; set; } } List shifts = new…
user2818430
  • 5,853
  • 21
  • 82
  • 148
5
votes
3 answers

Python start date_range from a specific hour

I am trying to specify a date range in Python that begins on the day before the current day. However, I would like that date range to begin at 10:00:00. This is the code I am currently using import pandas as pd import datetime as dt date =…
pottolom
  • 279
  • 5
  • 17
5
votes
1 answer

Create custom date range, 22 hours a day python

I'm working with pandas and want to create a month-long custom date range where the week starts on Sunday night at 6pm and ends Friday afternoon at 4pm. And each day has 22 hours, so for example Sunday at 6pm to Monday at 4pm, Monday 6pm to Tuesday…
A1122
  • 1,324
  • 3
  • 15
  • 35
5
votes
4 answers

Split the current month in to weeks in php

I want to split the current month in to weeks like first day to saturday and then sunday to next saturday.For ex: for May month, So i want to split that like 2016-05-01 to 2016-05-07 2016-05-08 to 2016-05-14 2016-05-15 to 2016-05-21 2016-05-22 to…
Anu
  • 905
  • 4
  • 23
  • 54
5
votes
0 answers

Google Custom Search date range

I've been trying to set a daterange for the results I get on Google Custom Search but couldn't figure out how yet. My url, so far, looks like…
VmLino
  • 291
  • 1
  • 2
  • 7
5
votes
2 answers

Querying dates: is "dateval LIKE '2014-01-01%'" a best practice?

This answer suggests using greater/less than to query for the dates matching a given day. But one of the veterans of my company told me to use LIKE '2014-02-06%'. What's the best practice? Is there any significant advantage of one over the other?
Luis Sep
  • 2,384
  • 5
  • 27
  • 33
5
votes
4 answers

Crystal Reports Need to Group by Derived Date Range

Long time listner, first time caller. I'm using Crystal Reports 2010. I have daily trade information that I need to group together if the volume doesn't change. Here's what the data looks like. Trade# BegDate EndDate Volume 1 1/1/2012…
5
votes
4 answers

Select all records 'younger' than 7 days

I want to select all the records from [Orders] that have a [Submissiondate] less than 7 days. I'm completely stumped. This is the query I'm executing: SELECT * FROM [Orders] WHERE ([SubmissionDate] < @SubmissionDate) Doesn't work.
user1269384
  • 61
  • 1
  • 1
  • 3
4
votes
1 answer

MVC Model Range Validator?

i wnat to validate the datetime, My Code is: [Range(typeof(DateTime), DateTime.Now.AddYears(-65).ToShortDateString(), DateTime.Now.AddYears(-18).ToShortDateString(), ErrorMessage = "Value for {0} must be between {1} and {2}")] …
artwl
  • 3,502
  • 6
  • 38
  • 53
4
votes
3 answers

Grouping Date Range by Week

I have a date range where a start date is 2 years prior to today. e.g.) '05/29/2007' ~ '05/29/2009'. How can I break above date range so that I would get a list like the following? (start date starts with "05/27/2007", not "05/29/2007" since the…
dance2die
  • 35,807
  • 39
  • 131
  • 194