Sunday Date Glitch!
Hello.
I've noticed that this week (last week of October 2010) in the week view, I have 2 Saturdays (I'm using {scroll in week view by days}:
It's "Saturday, Oct 30", then "Saturday, Oct 30" instead of "Sunday, Oct 31"!
This happens only in the week view. But when I place the misinterpreted day (Sunday) at the beginning of the week, it changes to the actual date "Sunday, Oct 31"
Is this thing only happening with me or with all iCals of the same version (3.0.8 0n Mac OS 10.5.8)?
And can it be corrected, or it needs an update?
I don't think you can do anything about that as obviously you can't do anything to affect files already on some-one's computer. Although iTunes determines the date initially from the feed it must store the information with the file (because when you remove an episode from the feed it doesn't disappear from subscribers' lists), so I can't see any workaround that doesn't involve asking subscribers to delete the episodes and re-download them.
Similar Messages
-
Allow datapicker to only allow Sunday dates to be selected
Is it possible to limit the users selection to just Sunday dates?
If so what would be the best approach?
Thank youHi
This macro should do what you're asking.
Private Sub DTPicker1_CloseUp()
Dim MyDate As Date, MyWeekDay As Integer
MyDate = DTPicker1.Value
MyWeekDay = Weekday(MyDate)
If MyWeekDay <> 1 Then
MsgBox "You must select a Sunday only"
Else
Range("A3") = DTPicker1.Value
Unload Me
End If
End Sub
A made a sample file with that macro at the link below.
http://dropcanvas.com/1dfqb
If that answered your question, please mark the post "Answered"
Cimjet -
Calculate the Sunday date based on 0CALDAY
Hi All,
How to Calculate the Sunday date based on 0CALDAY
Thanks in advance
CPYuse customer exit where you can use this FM /OSP/GETDATE_WEEKDAY
-
FM to get previous sunday date based on current date(SY-DATUM)
hi all,
Is there any function module to get the previous sunday date based on current date(sy-datum)?
Regards,
Kapil SharmaHi Kapil,
You can follow the logic below:
data:
l_date like sy-datum, **TODAY
l_date2 like sy-datum, **Previous Sunday
data:
l_daynr like HRVSCHED-DAYNR.
*Get today's date
l_date = sy-datum.
*Gey today's day (Monday, Tuesday, etc.)
CALL FUNCTION 'HRIQ_GET_DATE_DAYNAME'
EXPORTING
langu = 'EN'
date = l_date
IMPORTING
daynr = l_daynr.
CASE l_daynr.
*If it is Monday
WHEN 1.
-Subtract 2 days for the previous Sunday
CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
EXPORTING
id_date = l_date
id-operator = '-'
is_duration = 2
IMPORTING
ed_date = l_date2.
*If it is Tuesday
WHEN 2.
CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
EXPORTING
id_date = l_date
id-operator = '-'
is_duration = 3
IMPORTING
ed_date = l_date2.
*If it is Wednesday
WHEN 3.
CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
EXPORTING
id_date = l_date
id-operator = '-'
is_duration = 4
IMPORTING
ed_date = l_date2.
*If it is Thursday
WHEN 4.
CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
EXPORTING
id_date = l_date
id-operator = '-'
is_duration = 5
IMPORTING
ed_date = l_date2.
*If it is Friday
WHEN 5.
CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
EXPORTING
id_date = l_date
id-operator = '-'
is_duration = 6
IMPORTING
ed_date = l_date2.
*If it is Saturday
WHEN 6.
CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
EXPORTING
id_date = l_date
id-operator = '-'
is_duration = 7
IMPORTING
ed_date = l_date2.
*If it is Sunday
WHEN 7.
CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
EXPORTING
id_date = l_date
id-operator = '-'
is_duration = 8
IMPORTING
ed_date = l_date2.
ENDCASE.
Regards,
Dilek -
FM to get the previous sunday date based on current date(sy-datum)
hi all,
Is there any function module to get the previous sunday date based on current date(sy-datum)?
Regards,
Kapil Sharma
Moderator Message: Basic date related questions are not allowed
Edited by: Suhas Saha on Sep 19, 2011 11:39 AMHi,
There are function modules to find out the current day of the week depending on sy-datum. These are as below:
1. DATE_COMPUTE_DAY - Returns a number indicating what day of the week the date falls on. e.g. Monday is returned as a 1, Tuesday as 2,...., Sunday as 7.
2. RH_GET_DATE_DAYNAME - Returns the day based on the date provided, e.g. Monday, Tuesday,..., Sunday.
Using any of the above, if you can find out the current day, then you can calculate and compute the date of the previous Sunday.
My observation is that using the first FM might make the calculation simpler.
Hope this is of help to you.
Regards,
Shayeree -
How to get week starting with sunday date
Hi
I have a date column "start_date", i need to create a report for all the weeks starting from sunday , for eg:
i need to get week dates as :
mm/dd/yy - 01/23/11 , 01/16/11 , 01/09/11 and so on...
Please help
Thanks...Hi,
To find the last Sunday before or equal to start_date:
SELECT TRUNC ( start_date + 1
, 'IW'
) - 1 AS week_start_date
...You can use an expression like this in a GROUP BY clause, also.
This does not depend on you NLS settings. ISO weeks always start on Monday. Your week starts 1 day earlier, so that's why the expression above has the +1 and -1.
(Depending on you NLS settings,
SELECT TRUNC ( start_date
, 'D'
) AS week_start_date
...might do the same thing, but I still rocommend using 'IW'; a few extra keystrokes isn;t much to pay for a guarantee that it will always work.)
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements) and the results you want from that data. -
Getting the Sunday dates using Next_Day
The requirement is:
Get the Sunday of this week and Sunday of the last week. As system date is 02-July, this Sunday is 01-July and last week Sunday is 24-Jun. If say suppose the system date is 01-July, then this Sunday should be 24-Jun and last Sunday should be 17-Jun. I tried something like :
Select
Next_Day(sysdate-8,'SUNDAY') sunday,
Next_Day(sysdate,'SUNDAY') End_Sunday,
To_Char(Next_Day(sysdate-8,'SUNDAY'),'YYYYMMDD') sun_mm,
1 Fl
From
Dual
Union
Select
Next_Day(sysdate-16,'SUNDAY') sunday,
Next_Day(sysdate-16,'SUNDAY')+7 End_Sunday,
To_Char(Next_Day(sysdate-16,'SUNDAY'),'YYYYMMDD') sun_mm,
2 Fl
From
Dual
I know the above doesn't work due to -16. Need some help in meeting the requirement.
Thanks
Chaitanya.S.S.KMicheals,
this?
SQL> alter session set nls_territory=germany;
Session altered.
SQL> WITH t AS ( SELECT SYSDATE AS DT FROM dual
2 UNION ALL
3 SELECT TO_DATE('07/01/2007','MM/DD/YYYY') FROM dual
4 UNION ALL
5 SELECT TO_DATE('07/02/2007','MM/DD/YYYY') FROM dual
6 UNION ALL
7 SELECT TO_DATE('06/30/2007','MM/DD/YYYY') FROM dual)
8 SELECT DT, CASE WHEN TO_CHAR(DT,'DY')='SUN' THEN
9 TRUNC(dt,'d')-7
10 ELSE
11 TRUNC(dt,'d')
12 END last_sunday
13 FROM t;
DT LAST_SUN
03.07.07 02.07.07
01.07.07 18.06.07
02.07.07 02.07.07
30.06.07 25.06.07
SQL> alter session set nls_territory=america;
Session altered.
SQL> WITH t AS ( SELECT SYSDATE AS DT FROM dual
2 UNION ALL
3 SELECT TO_DATE('07/01/2007','MM/DD/YYYY') FROM dual
4 UNION ALL
5 SELECT TO_DATE('07/02/2007','MM/DD/YYYY') FROM dual
6 UNION ALL
7 SELECT TO_DATE('06/30/2007','MM/DD/YYYY') FROM dual)
8 SELECT DT, CASE WHEN TO_CHAR(DT,'DY')='SUN' THEN
9 TRUNC(dt,'d')-7
10 ELSE
11 TRUNC(dt,'d')
12 END last_sunday
13 FROM t;
DT LAST_SUND
03-JUL-07 01-JUL-07
01-JUL-07 24-JUN-07
02-JUL-07 01-JUL-07
30-JUN-07 24-JUN-07 -
Get a saturday and sunday dates
HI,
i need a days which are sunday and saturday, when i given a range of period i want to get days which are saturday and sunday within that range.
if any fm just suggest me.
Tahnks a lot.Hi,
Please find below an example on how to get the Weekend in shorttext, the dates and the total of weekend for the input date. I used only the FM ''DAY_ATTRIBUTES_GET'' . Please reward if you found useful. Thanks
REPORT zastest.
Data Declaration
TABLES : scal.
DATA : itab TYPE TABLE OF casdayattr,
wa_itab LIKE LINE OF itab.
DATA : l_line TYPE i,
l_wkend TYPE i.
Selection Screen
SELECT-OPTIONS p_date FOR scal-date.
START-OF-SELECTION.
CLEAR : l_wkend.
CALL FUNCTION 'DAY_ATTRIBUTES_GET'
EXPORTING
FACTORY_CALENDAR = ' '
HOLIDAY_CALENDAR = ' '
date_from = p_date-low
date_to = p_date-high
language = sy-langu
NON_ISO = ' '
IMPORTING
YEAR_OF_VALID_FROM =
YEAR_OF_VALID_TO =
RETURNCODE =
TABLES
day_attributes = itab
EXCEPTIONS
FACTORY_CALENDAR_NOT_FOUND = 1
HOLIDAY_CALENDAR_NOT_FOUND = 2
date_has_invalid_format = 3
date_inconsistency = 4
OTHERS = 5
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN '3'.
WRITE : 'Date has Invalid Format'.
when '4'.
WRITE : 'Date Inconsistency'.
WHEN '5'.
WRITE : 'Other exceptions'.
ENDCASE.
ELSE.
DESCRIBE TABLE itab LINES l_line.
IF l_line GT 0.
LOOP AT itab INTO wa_itab.
WRITE : / wa_itab-day_string.
CASE wa_itab-weekday.
WHEN '6'. l_wkend = l_wkend + 1.
WHEN '7'. l_wkend = l_wkend + 1.
WHEN OTHERS.
ENDCASE.
ENDLOOP.
WRITE : / 'l_wkend - ', l_wkend.
ENDIF.
ENDIF.
END-OF-SELECTION.
Regards,
Loo -
What I am basically trying to do is to take a range of dates
using a start date and an end date and calculate each time the
first of a month is hit, but I am having a problem with this
script.
Here is what I am putting in:
startDate = new Date(2006,9,1);
endDate = new Date(2009,0,1);
durationInDays = Math.floor((endDate-startDate)/86400000);
var trackDate = new Date(startDate.getTime());
for(u=0;u<durationInDays;u++){
if(trackDate.getDate()==1){
trace(trackDate);
trackDate = new Date(trackDate.getTime() + 86400000);
stop();
Here is what I am getting out...
Sun Oct 1 00:00:00 GMT-0400 2006
Wed Nov 1 23:00:00 GMT-0500 2006
Fri Dec 1 23:00:00 GMT-0500 2006
Mon Jan 1 23:00:00 GMT-0500 2007
Thu Feb 1 23:00:00 GMT-0500 2007
Thu Mar 1 23:00:00 GMT-0500 2007
Tue May 1 00:00:00 GMT-0400 2007
Fri Jun 1 00:00:00 GMT-0400 2007
Sun Jul 1 00:00:00 GMT-0400 2007
Wed Aug 1 00:00:00 GMT-0400 2007
Sat Sep 1 00:00:00 GMT-0400 2007
Mon Oct 1 00:00:00 GMT-0400 2007
Thu Nov 1 23:00:00 GMT-0500 2007
Sat Dec 1 23:00:00 GMT-0500 2007
Tue Jan 1 23:00:00 GMT-0500 2008
Fri Feb 1 23:00:00 GMT-0500 2008
Sat Mar 1 23:00:00 GMT-0500 2008
Tue Apr 1 23:00:00 GMT-0500 2008
Thu May 1 00:00:00 GMT-0400 2008
Sun Jun 1 00:00:00 GMT-0400 2008
Tue Jul 1 00:00:00 GMT-0400 2008
Fri Aug 1 00:00:00 GMT-0400 2008
Mon Sep 1 00:00:00 GMT-0400 2008
Wed Oct 1 00:00:00 GMT-0400 2008
Sat Nov 1 23:00:00 GMT-0500 2008
Mon Dec 1 23:00:00 GMT-0500 2008
Where is April 1, 2006? I noticed this happens every 6 years
too. Same result in 2012, 2018, etc...
I am running Flash Pro 8.0 on a WinXP platform.
Some people on the actionScript.org site claim that it works
fine for them, but it does not work for me on any of my three
different computers I have tried...it also did not work when I
tried it in macromedia flash 2004.I don't think you can do anything about that as obviously you can't do anything to affect files already on some-one's computer. Although iTunes determines the date initially from the feed it must store the information with the file (because when you remove an episode from the feed it doesn't disappear from subscribers' lists), so I can't see any workaround that doesn't involve asking subscribers to delete the episodes and re-download them.
-
Hii
I have a real issue regarding FI Calendar year .In my case the financial runs for April to March.But there is a financial year variant maintained for Nov-Oct financial year also,which taked the circle sunday concept of period definition i.e the dates of a month say 30 Nov can be counted into the month of Dec depending upon the weekday .
Please help me out to find FM to check for a date under which month it is to be counted?
Regards
AjitabhHi,
you can use the FM <b>GET_WEEK_INFO_BASED_ON_DATE</b>, pass the date it will give the Monday date and sunday date of the week for the date which falls in.
Regards
vijay -
Does anyone know how to remove sundays from the datepicker in BC?
I have a client that is closed on Sundays and occasionally gets an irate customer that books late saturday and is upset that no one is there on Sundays. So I would really like to remove the option of Sundays from the date picker.
Hi guys,
I had the same problem as jbyrom and found a work-around using a bit of jQuery. Before I begin...
Downsides
It's a bit of a pain if you have tons of date fields, as you'll need to add a class to each datepicker field
Because you need to add a class to each datepicker field, you'll need to add the Web Form as HTML (ie make sure "insert as module instead" is unchecked when adding the form to a page)
As mentioned, it's a work-around - may stop working in the future if Adobe changes the way the datepicker works
Users could still put in "restricted" dates by manually typing the date instead of clicking the date in the datepicker
How-To
Add a class to each datepicker field you want to restrict days on (I'm using "datepickerhack").
Add the script below the form (ie at least after the closing </form> tag). This is so jQuery and BC's Java_Datepick.js are loaded before the script.
Add some CSS to your stylesheet to make it obvious to them they can't click certain dates.
Script
<script type="text/javascript">
$(document).ready(function(){
$(".datepickerhack").focus(function(){
// Grab the ID of the relevant date field and use it to call the built-in BC displayDatePicker function
var datetable = $(this).attr("id");
displayDatePicker(datetable);
// Now the date table is in the DOM, remove the onclick events of the appropriate TDs
// In this example I'm removing the onclick event of the first TD in each row (ie Sunday)
$(".date tr td:first-child").attr("onclick","");
return false;
</script>
CSS
Last step is something simple for usability, so users know they can't click the unclickable days. I just used:
.date tr td:first-child{background-color:#CCC;}
.date tr:last-child td{background-color:#FFF;}
The second line is needed as the last row contains the "Today"/"Clear"/"Close" buttons (as opposed to dates)
Edit: fixed formatting, added last "Downside" -
Qurey to get all the sundays in a year
Hello,
Can anyone help me in building a qurey that returns all the sundays in a year (from 01-Jan to 31-Dec)?
I'll be grateful.
Hasan.create or replace type sunday_row as object (sunday date);
create or replace type sunday_table as table of sunday_row;
create or replace function sundays (year_in in varchar2)
return sunday_table
pipelined
is
outrow sunday_row := sunday_row (sysdate);
day_of_month_n number(1);
sunday_d date;
begin
day_of_month_n := to_number(to_char(next_day (to_date('01-JAN-'||year_in, 'DD-MON-YYYY'), 'Sunday'), 'DD'));
if day_of_month_n = 8 then day_of_month_n := 1; end if;
sunday_d := to_date(to_char(day_of_month_n)||'-JAN-'||year_in, 'DD-MON-YYYY');
while to_char(sunday_d, 'YYYY') = year_in
loop
outrow.sunday := sunday_d;
pipe row(outrow);
sunday_d := sunday_d + 7;
end loop;
return;
end;
select sunday from table(sundays('1996'));
SUNDAY
07/01/1996
14/01/1996
21/01/1996
15/12/1996
22/12/1996
29/12/1996
AMM -
Function module for sundays in a month
hai all,
i need a function module for calculating noof sundays in a monthHi Satya,
Please check this code which is checked for syntax also. Just copy and paste the same in abap editor and check the output.
Calculation of number of sundays ****
DAta : month1(2) type c,
week1 type i,
date1 type sy-datum,
val1 type sy-datum,
day1 type SCAL-INDICATOR,
no_sundays type i.
week1 = 5.
date1 = '20060502'.
*- Function Module to fetch the Last day of the Month
CALL FUNCTION 'LAST_DAY_OF_MONTHS'
EXPORTING
DAY_IN = date1
IMPORTING
LAST_DAY_OF_MONTH = VAL1.
*- Function Module to get the day of the week
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
DATE = VAL1
IMPORTING
DAY = DAY1.
*- Calculation of number of sundays
month1 = val1+6(2).
write : / month1.
if month1 = 31.
if DAY1 <= 2 or DAY1 = 7.
no_sundays = week1.
else.
no_sundays = week1 - 1.
endif.
elseif month1 = 30.
if DAY1 = 1 or DAY1 = 7.
no_sundays = week1.
else.
no_sundays = week1 - 1.
endif.
elseif month1 = 29.
if DAY1 = 7.
no_sundays = week1.
else.
no_sundays = week1 - 1.
endif.
elseif month1 = 28.
no_sundays = 4.
endif.
write : / no_sundays.
If found helpful, please do reward. -
Sql query to fetch data based on date conditons
Hi All,
We have to schedule a script that runs at 1:00 AM from Monday to Friday.
The script will run a sql query ,that will fetch the data from sql database 2008 based on the below conditions.
Case 1: If date = current Date then retrieve the data of the previous Date.
Case 2: If date = Monday then retrieve the entries of Friday ,Saturday and Sunday.
Please help us on how we can achieve this.
ThanksHi,
Are you asking about Patrick's
solution?
If so I highly recommend NOT to use this solution. PLease read LMU92's
and
Visakh16's responses.
Why not to use it?
1. This solution is not deterministic!
A deterministic algorithm is an algorithm which, given a particular input, will always produce the same output. This solution give different values for different setting! It is depending for example on "SET LANGUAGE" value
As mentioned above if you try to use any other languge then English then this query will not work since you will never get the value "Sunday"
2. Moreover! Even if you are using "SET LANGUAGE 'English'" then this
solution depend on "SET DATEFIRST" and only take into consideration that the value can be 1 or 7, using any other value you will get that @weekendDateMod is null!
What can you use?
let's test some value first to get the solution yourself. We know that we don't care about "SET LANGUAGE" since I will not use any language dependency but we need to examine "SET DATEFIRST". Try to change the value from 1 to 7 and check
the value of this query
SET DATEFIRST 1 -- Change this value from 1 to 7!
DECLARE @Sunday DATE = '2014-08-03' -- This is Sunday
DECLARE @Munday DATE = '2014-08-04' -- This is Munday
SELECT DATEPART(DW,@Sunday),DATEPART(DW,@Munday), @@DATEFIRST
Can you see the behavior ?
The results are hidden here (select the text and you will see them)
DATEFIRST___Sunday_______Monday
1___________7___________1
2___________6___________7
3___________5___________6
4___________4___________5
5___________3___________4
6___________2___________3
7___________1___________2
assuming you did the exercise above yourself, then you can now think now what is the filter that you need...
You can use a filter on those two parameters together using "where DATEPART... and @@DATEFIRST...) or using one combine check. Can you think how?
Notice that this value is always 2 on Monday! Regarding our setting
(DATEPART(DW,@CurrentDate) + @@DATEFIRST) % 7
Please Don't Go Down Before YOu Understand!
Now we can go to the solution
* I really hope that you read all and did the small exercise yourself! You can not become a developer by copy answers, and this is the reason that from the start I only gave you tha way and not the final query!
DECLARE @CurrentDate DATE = '2007-08-20' -- This is only for testing since you should use the function GETDATE() instead
DECLARE @MinDateToFilter DATE
SET @MinDateToFilter = CASE
WHEN ((DATEPART(DW,@CurrentDate) + @@DATEFIRST) % 7) = 2 THEN DATEADD(DAY,-4,@CurrentDate)
ELSE DATEADD(DAY,-1,@CurrentDate)
END
SELECT *
FROM sales.salesOrderHeader
WHERE orderDate > @MinDateToFilter
I hope this was useful :-)
[Personal Site] [Blog] [Facebook] -
All the dayname dates of a previous month
i have a date '01/25/2015' which is sunday. how to get all the sunday dates of the previous month
so the result is
07/12/2014, 14/12/2014, 21/12/2014, 28/12/2014Because you asked to see all Sundays in Previous Month. I am guessing you want the same day(Monday, Tuesday, ...) from previous month based on the day that you passed.
If so, please check:
DECLARE @Today DATE = CURRENT_TIMESTAMP -- You can change to any date that you want
DECLARE @myDate DATE = DATEADD(MONTH, DATEDIFF(MONTH, '01/01/1900', @Today) - 1, '01/01/1900')
WHILE @myDate < DATEADD(MONTH, DATEDIFF(MONTH, '01/01/1900', @Today), '01/01/1900')
BEGIN
IF DATEPART(WEEKDAY, @myDATE) = DATEPART(WEEKDAY, @Today)
BEGIN
PRINT(@myDate)
END
SET @myDate = DATEADD(DAY, 1, @myDate)
END
Best Wishes, Arbi; Please vote if you find this posting was helpful or Mark it as answered.
Maybe you are looking for
-
Can we get the name of fmx file at runtime
Hi all, can we get the name of fmx file which is doing some DML operation on a specific table Can we back track which fmx module has done DML on a specific table. The reason I need this because I've 7 different fmx files which are doing some DML oper
-
Time Machine not backing up. Very slow, essentially hanging. I have 10.7.5 Mac OS X Lion (11G63). I have put in all updates. I tried to put my folders into "private" in the Spotlight (b/c I read that might be the problem). Still not working. Tha
-
How to edit customizing view in production system?
Hi, I wonder if it is possible to edit customizing view (ex: tcode OAV8) directly in production system. I need a method that doesn't require repair. Any help will be appreciated..
-
Cannot boot from recovery, yet hardware diagnostics finds no problem
Hello, I have a mid-2011 MacBook Air 11" which is running Mountain Lion, with most recent updates. No new software recently installed, and I was running Pages and a few other standards apps, when.... suddenly, computer started just going black and r
-
I am having several problems with ios5 and wanted to see if anyone can help. Toughts? 1) the notifications pane does not appear to be working as configured and now general notifications from non-apple apps are not working. Notifications for phone,