Calender form - hiding weekends Saturday and Sunday
I have a Calendar page and I want it to only show business days, hiding the weekends. I found some code that halfway worked in this thread:
https://forums.oracle.com/thread/684334
But as it's old, I figured I would start another as the code isn't working entirely. I placed it in the header region of the Calendar and it works when you initially open the page, but if you click the [Monthly] button, Saturday and Sunday re-appear until you refresh the page.
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
$tblRows = $('table.t13Calendar tr');
$tblRows.each(function() {
$tblDatas = $(this).children('td, th');
$tblDatas.eq(0).remove();
$tblDatas.eq(6).remove();
//]]>
</script>
When you click the buttons the Calendar code changes with a PPR (Partial Page Refresh) thus HTML is all new and different. The code only runs once (on document ready)
So... add a Dynamic action that runs After Refresh of your region and runs the code (minus the script, the CDATA and the document .ready).
$tblRows = $('table.t13Calendar tr');
$tblRows.each(function() {
$tblDatas = $(this).children('td, th');
$tblDatas.eq(0).remove();
$tblDatas.eq(6).remove();
I'm surprised it works because it has the t13Calendar class in there, that's theme specific, you must be using the same theme.
Thanks
-Jorge
http://rimblas.com/blog/
Similar Messages
-
Identifying Saturday and Sunday from calender dates
Hi all,
i have a table with all the date of year from 200 to till date.
now i want to identify all those dates from this table which are saturdays and sundays,
how can i do this?
please advice...
thanks.Depends on what the nls_territory parameter is set to:
alter session set nls_territory='UNITED KINGDOM';
select to_char(sysdate, 'd', 'nls_date_language=american') monday,
to_char(sysdate -1, 'd', 'nls_date_language=american') sunday
from dual;
M S
1 7
alter session set nls_territory='AMERICA'
select to_char(sysdate, 'd', 'nls_date_language=american') monday,
to_char(sysdate -1, 'd', 'nls_date_language=american') sunday
from dual;
M S
2 1Edited by: Boneist on 06-Jul-2009 12:01
BluShadow is too fast for me! -
Billing date is for Monday for the orders created on Saturday and Sunday
Hi Friends,
I have an issue,that for the orders that are created on weekdays, the Billing date is for the same day.
But for the orders that are created on Saturday and Sunday,the Billing date is being determined automatically for Monday.
The goods are service material and ther is no delivery being created for these goods.Still the requested delivery date is being determined for Monday for the weekend orders.
Any idea where i can check these settings or which program or userexit can be looked into for this.
Thanks in advance...
Sultan KhanHi,
How about using BBP_DOC_CHANGE_BADI ?
Regards,
Masa -
Query to get holidays including saturday and sunday by giving month and year as input
query to get holidays including saturday and sunday by giving month and year as input.
Hi,
Create a table for holidays. You could INSERT one row for each holiday in each year, but it might be more useful if you just create 1 row for every day, with a column that tells whether that day is a holday, part of a weekend, or a work day.
See
http://forums.oracle.com/forums/message.jspa?messageID=3351081
for a user-defined function that tests if a given DATE is holiday.
You could use such a function when populating the table I mentioned earlier. -
Schedule line delivery date on saturday and sunday its confirm for monday
HI Experts
in cash sales process or normal OR also when i create sales order monday its work fine system take todays (current date) as delivery date and i can do delivery on same date
but if i create sales order on saturday system take coming monday as delivery date and give goods confirmation on monday date but iif i change manually system allow me to change the date for saturday and i can do delivery but i want it system should take delivery date as saturday (same date only )
because in my client there is no holiday all 365 as working day
in VOV8 its blank no lead time
factory calendor and logistic i define as all 7 days as working day
and sales org and plant i assign calendor
Please guide me where i miss and how can i solve this issue
thanks in advanceHi,
Check "OVLY" and "OVLZ" and If the sceduling is active for he shipping point /sales document type. Check "OVXD" and see If the Loading time/ Pick/pack time is determined from it. If they are getting determined from shipping point check the shipping point calender in "SCAL" .If it has saturday and sunday as holidays ,then you may have to change them. And check If the customer has goods recieving hours assigned to him (In customer master unloading point). If he has only 5 working days and If he accepts only goods at 8 am in the morining then system would propose like this.Kindly please let me know If you need any more Information on this.
Regards
Ram Pedarla -
Plan order is considering saturday and sunday as working day.
Hi All,
I have a problem where saturday and sunday is being conidered as working day when a plan order is created (Either manually or Automatically). But in calender assigned to this plant, saturday and sunday is assigned as holiday.
But when we convert the same plan order which has Saturday as Order start, the Basic start date of production order is moved to Firday.
EG. Plan order - XXXXXX has order finish date as 22-Aug-2011. Inhouse lead time is 2 days. So system takes 20-Aug-2011 as order srat date in plan order.
But when same Plan order is converted to Production order, then the Basic order start date is moved to 18-Aug-2011 and it says that 20-Aug-2011 and 21-Aug-2011 is maked as holiday in calender.
Can some one please suggest why is plan order considering Saturday and Sunday as working day.Hi,
Check the factory calendor assigned to plant which is referenced in plan order and teh factory calendor assigned to work center which is used in elad time scheduling in production order.. are they same?
Check how they ahve maintined..? -
Planned Delivery Time is included Saturday. and Sunday?
Dear Guru,
Please kindly advice me about Planned Delivery Time in Days in the MRP View.
Is it include Saturday and Sunday?
If my calendar is not work on Saturday and Sunday.
Thank you very much.
SaiyaSystem calculates with help of factory calender. if you maintaned saturday and sun day as public holidays then system will not considered for planned delivery time.
-
MF50 not able to book Capacity on Saturday and Sunday
Dear Experts,
In MF50 planning table the if we book requirement on Saturday and Sunday .we are abel to book the requirement but "Not yet assigned" is gyred out system is creating a back ward scheduling to friday.
In work Centre we maintained factory calender ( all the days are working) and shift sequence.
Please let me know the settings.
Regards
SandeepHi Sandeep,
Check your setting in T-code SCAL.
I think it might be require modification in days selection for Calender creation.
if any doubt then revert back.
Regards,
Mukesh. -
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 -
How to exclude 'Saturday' and 'sunday' In APEX 4.1 count(*)
Hi everyone am using APEX 4.1,
The Leave_transaction Table has the following Fields,
1.Leave_id
2.Emp_name
3.From_date
4.To_date
5.Remaining_days
The Emp_Master Table has the following columns,
1.Emp_id
2.Emp_Name
3.Remaining_days
select count(*) into days from (select dt
from(
select to_date(:p1_from_date, 'DD-Mon-YYYY') + rownum -1 dt
from dual
connect by level <= to_date(:p1_to_date, 'DD-Mon-YYYY') - to_date(:p1_from_date, 'DD-Mon-YYYY') + 1)
where to_char(dt,'fmday') not in ('sunday','saturday') dual;
If the Dates is between from_date and To_date comes in Saturday and sunday , it should exclude and return the count(*) remaining dates,
For example,
If the From_date is 04-may-2012'
and To_date is 08-may-2012,
Here the dates 5th may and 6th may are "saturday" and "sunday"
Then the remaining dates are(excluding sat,sunday and dates in holiday_table),
04-may-2012,
07-may-2012
08-may-2012.
so
count(*)
3I am using the above code but still it returning 5,
I think this
..where to_char(dt,'fmday') not in ('sunday','saturday')
code is not working.
Can anyone help me to solve my Issue.Hi theoa,
Actually this is my full code,
declare
days number(3);
ex_days emp_master.remaining_days%type;
new_rem_days emp_master.remaining_days%type;
begin
select count(*)
into days
from (select dt
from (select to_date (:p1_from_date, 'DD-Mon-YYYY',
'NLS_DATE_LANGUAGE=''english''')
+ rownum - 1 dt
from dual
connect by level <=
to_date (:p1_to_date, 'DD-Mon-YYYY',
'NLS_DATE_LANGUAGE=''english''')
- to_date (:p1_from_date, 'DD-Mon-YYYY',
'NLS_DATE_LANGUAGE=''english''')
+ 1)
where rtrim(to_char(dt,'fmDay', 'NLS_DATE_LANGUAGE=''english''')) not in
('Sunday','Saturday')
minus
(select holiday_start
from holiday_master)) dual;
apex_application.g_print_success_message := 'Hi '||:APP_USER||' '||'You are applied leave for'||' ' || days||' ' ||'days';
select remaining_days
into ex_days
from emp_master
where upper(emp_name) = upper(:APP_USER);
new_rem_days := ex_days - days;
update emp_master
set remaining_days = new_rem_days
where upper(emp_name) = upper(:APP_USER);
update leave_transaction
set remaining_days = new_rem_days
where upper(emp_name) = upper(:APP_USER)
and leave_id=
(select max(leave_id)
from leave_transaction);
end;The select statement which i mentioned above is working fine in database but not working in PAEX application. -
Calculate the number of days in a year excluding Saturday and Sunday
Hi All,
I need to get the number of days in a year excluding Saturday and Sunday for HR module and then subtract the public holidays.
Can some let me know how this needs to be done while loading data from one infocube to another.
Is there any Function module for the same so that i can write any start routines.
And also is there any table available for Tcode-SCAL with which i can write any start routines.
Kindly help me as soon as possible.
Regards,
KumarHi Harish
Refer to the screenshot for Import and Export parameters
Code
FUNCTION ZBI_FM_GET_HOLIDAYS .
*"*"Local Interface:
*" IMPORTING
*" VALUE(DATE_FROM) TYPE SCAL-DATE DEFAULT SY-DATUM
*" VALUE(DATE_TO) TYPE SCAL-DATE DEFAULT SY-DATUM
*" VALUE(FACT_CAL) TYPE SCAL-FCALID DEFAULT SPACE
*" VALUE(ONLYFACT_DAYS) TYPE CHAR1 OPTIONAL
*" EXPORTING
*" REFERENCE(HOLIDAYS) TYPE I
*" TABLES
*" DAY_ATTRIBUTES STRUCTURE CASDAYATTR
*" EXCEPTIONS
*" FACTORY_CALENDAR_NOT_FOUND
*" HOLIDAY_CALENDAR_NOT_FOUND
*" DATE_HAS_INVALID_FORMAT
*" DATE_INCONSISTENCY
DATA: LT_DAY_ATTRIBUTES TYPE TABLE OF CASDAYATTR WITH HEADER LINE.
DATA: LV_LINES TYPE SY-SUBRC.
DATA: DATE1 LIKE DATE_FROM,
DATE2 LIKE DATE_TO.
*if from date is gt to date then interchange the dates and multiply the result with -1.
IF DATE_FROM GT DATE_TO.
DATE2 = DATE_FROM.
DATE1 = DATE_TO.
ELSE.
DATE1 = DATE_FROM.
DATE2 = DATE_TO.
ENDIF.
CALL FUNCTION 'DAY_ATTRIBUTES_GET'
EXPORTING
FACTORY_CALENDAR = FACT_CAL
* HOLIDAY_CALENDAR = ' '
DATE_FROM = DATE1
DATE_TO = DATE2
LANGUAGE = SY-LANGU
* IMPORTING
* YEAR_OF_VALID_FROM =
* YEAR_OF_VALID_TO =
* RETURNCODE =
TABLES
DAY_ATTRIBUTES = LT_DAY_ATTRIBUTES
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.
IF ONLYFACT_DAYS = 'X'.
DELETE LT_DAY_ATTRIBUTES WHERE FREEDAY EQ SPACE.
ELSE.
DELETE LT_DAY_ATTRIBUTES WHERE WEEKDAY LT 6.
ENDIF.
DESCRIBE TABLE LT_DAY_ATTRIBUTES LINES LV_LINES.
HOLIDAYS = LV_LINES.
* IF DATE_FROM GT DATE_TO.
* HOLIDAYS = HOLIDAYS * -1.
* ENDIF.
ELSEIF SY-SUBRC = 1.
RAISE FACTORY_CALENDAR_NOT_FOUND.
ELSEIF SY-SUBRC = 2.
RAISE HOLIDAY_CALENDAR_NOT_FOUND.
ELSEIF SY-SUBRC = 3.
RAISE DATE_HAS_INVALID_FORMAT.
ELSEIF SY-SUBRC = 4.
RAISE DATE_INCONSISTENCY.
ENDIF.
ENDFUNCTION. -
Hi All,
I have a simple query which is below:-
Declare @reportdate date
set @reportdate= (DATEADD(dd,-5,getdate()))
select * from dbo.Table
where date IN (@reportdate)
I need this query to pull the data for the last 3rd business day .So lets say today is monday then i need the data for last week wednesday which is 3 business days back from monday, if today is a tuesday it would be for last thursday ( as 3 business days for
tuesday would be thursday). But if today is wednesday then i need to be last 3rd business day which is last friday and i also need to get the data for saturday and sunday.
Can someone please help me how cani change my filter to do this?
Please let me know if i am still unclear.
ThanksHi SqlDev12,
Based on my understanding on your requirement, you can reference the below sample.
CREATE TABLE BusinessTable
Bdate DATE,
Wd VARCHAR(10)
;WITH Cte(DT,WD) AS
SELECT CAST('20150401' AS DATE),DATENAME(WEEKDAY,CAST('20150401' AS DATE))
UNION ALL
SELECT DATEADD(DAY,1,DT),DATENAME(WEEKDAY,DATEADD(DAY,1,DT)) FROM Cte
WHERE DT<GETDATE()
INSERT INTO BusinessTable SELECT * FROM Cte
SELECT * FROM BusinessTable
SET DATEFIRST 7 -- Set Sunday as the first day of a week
DECLARE @givenDay DATE ='20150415' --Wednesday
SELECT * FROM BusinessTable
WHERE Bdate BETWEEN
--For Monday and Sunday, select last wednesday
(CASE WHEN DATEPART(WEEKDAY,@givenDay) IN(1,2) THEN DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay)-1,0))
--For Tuesday and Wednesday, last week's Thursday and Friday
WHEN DATEPART(WEEKDAY,@givenDay) IN(3,4) THEN DATEADD(DAY,-5,@givenDay)
--For Thursday and Friday, current week's Monday and Tuesday
WHEN DATEPART(WEEKDAY,@givenDay) IN(5,6) THEN DATEADD(DAY,-3,@givenDay)
--For Saturday, current week's Wednesday
ELSE DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay),0)) END)
AND
(CASE WHEN DATEPART(WEEKDAY,@givenDay) IN(1,2) THEN DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay)-1,0))
WHEN DATEPART(WEEKDAY,@givenDay) IN(3) THEN DATEADD(DAY,-5,@givenDay)
WHEN DATEPART(WEEKDAY,@givenDay) IN(4) THEN DATEADD(DAY,-3,@givenDay)
WHEN DATEPART(WEEKDAY,@givenDay) IN(5,6) THEN DATEADD(DAY,-3,@givenDay)
ELSE DATEADD(DAY,2,DATEADD(WEEK,DATEDIFF(WEEK,0,@givenDay),0)) END)
DROP TABLE BusinessTable
If you have any feedback on our support, you can click
here.
Eric Zhang
TechNet Community Support -
How to jump (saturday and sunday) a task on friday to monday
hi
i had a 'long' task (2 days)
i need to begin friday
and end on monday
so, i w jump saturday and sunday
thks for your lightsso
ical/pref/days per week
it's useless
I am disappointed to see that implemented function is useless
...I will make with...
Tks ferd -
Number of a day of an year without saturday and sunday
Hi,
How can I get the number of the day of an year?
How can I remove, from this number the saturday and the sunday? Should I check day by day?
Thanks, bye bye.Or you can function NEXT_DAY, some math and table dual:
to_char(to_date(6,'j'),'Day') is NLS independent way of representing Sunday and to_char(to_date(5,'j'),'Day') is NLS independent way of representing Saturday.
NEXT_DAY(start_date - 1,to_char(to_date(6,'j'),'Day')) is first sunday >= start_date. NEXT_DAY(end_date - 7,to_char(to_date(6,'j'),'Day')) is last Sunday <= end_date. Therefore:
(NEXT_DAY(end_date - 7,to_char(to_date(6,'j'),'Day')) - NEXT_DAY(start_date - 1,to_char(to_date(6,'j'),'Day'))) / 7 + 1 is number of Sunday's between start_date and end_date. Same way:
(NEXT_DAY(end_date - 7,to_char(to_date(5,'j'),'Day')) -
NEXT_DAY(start_date - 1,to_char(to_date(5,'j'),'Day'))) / 7 + 1 As a result, number of weekdays between start_date and end_date is:
end_date - start_date + 1 -((NEXT_DAY(end_date - 7,to_char(to_date(6,'j'),'Day')) -
NEXT_DAY(start_date - 1,to_char(to_date(6,'j'),'Day'))) / 7 + 1 +
(NEXT_DAY(end_date - 7,to_char(to_date(5,'j'),'Day')) -
NEXT_DAY(start_date - 1,to_char(to_date(5,'j'),'Day'))) / 7 + 1) or
end_date - start_date - 1 -(NEXT_DAY(end_date - 7,to_char(to_date(6,'j'),'Day')) -
NEXT_DAY(start_date - 1,to_char(to_date(6,'j'),'Day'))) / 7 -
(NEXT_DAY(end_date - 7,to_char(to_date(5,'j'),'Day')) -
NEXT_DAY(start_date - 1,to_char(to_date(5,'j'),'Day'))) / 7 or:
SELECT end_date - start_date - 1 -(NEXT_DAY(end_date - 7,to_char(to_date(6,'j'),'Day')) - NEXT_DAY(start_date - 1,to_char(to_date(6,'j'),'Day'))) /
7 - (NEXT_DAY(end_date - 7,to_char(to_date(5,'j'),'Day')) - NEXT_DAY(start_date - 1,to_char(to_date(5,'j'),'Day'))) / 7
FROM DUAL; Now:
WITH t AS (
SELECT to_char(to_date(6,'j'),'Day') sunday,
to_char(to_date(5,'j'),'Day') saturday,
DATE '2009-01-01' start_date,
DATE '2009-12-31' end_date
FROM dual
SELECT end_date - start_date - 1 -(NEXT_DAY(end_date - 7,sunday) - NEXT_DAY(DATE '2009-01-01' - 1,sunday)) /
7 - (NEXT_DAY(end_date - 7,saturday) - NEXT_DAY(start_date - 1,saturday)) / 7
FROM t
END_DATE-DATE'2009-01-01'-1-(NEXT_DAY(END_DATE-7,SUNDAY)-NEXT_DAY(DATE'2009-01-0
261
SQL> SY. -
Original GI date should display closest day when Saturday and Sunday comes
Hi Guys,
I am getting Original GI Date as After deducting Transit time from Original Delivery Date.
But i want to fullfill the below requiremnt also.
the Original GI Date should be then the working day defined in the calendar of the shipping point. Thus if the calculation gives Original GI Date to be Sunday 4.3.2012 then it should changed to the closest previous working date which is Friday 2.3.2012 (calendar 'YT').
Any one help me how to execute the above requiremnt.
regards
reddy.Hi,
Pass your GI date to below given FM, it will return you the day of the week.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
DATE = GI_DATE
IMPORTING
DAY = day_of_week_num
EXCEPTIONS
OTHERS = 8.
the value returned by this FM in day_of_week_num will be between 1 to 7, 1 representing Monday and 6 = Saturday and 7 = sunday.
Now if your working days are from monday to friday then simply check the value returned by this FM is it is 6 then you can subtract 1 for last friday or add 2 for next monday and in the same fashion if value returned is 7 then subtract 2 for last friday and add 1 for next monday in GI date.
For adding and subtracting value from GI date you can use FM RP_CALC_DATE_IN_INTERVAL. And if you need to check some settings related to Factory calander then you can use FM DATE_CONVERT_TO_FACTORYDATE.
Regards,
Durgesh.
Maybe you are looking for
-
My computer was stolen with all my iTunes on it. However, my iPod was not stolen. How do I transfer all files from my iPod to my new computer (purchased files and files I copied from CDs)?
-
FaceTime HD Camera (Display) not working with most applications
The Thunderbolt 27" LED Cinema displays built in camera is not working with most applications. The camera does not work with FaceTime, iChat, Skype and Google Talk. FaceTime says "There is no connected camera", even though there is. Weird thing is it
-
What product do I need to create personal eBooks?
Google Books has suggested I generate my own ePub files from PDFs, but I'm not sure what product will do this. I am only converting my own materials, so this is a personal application, not corporate or group. Anything (dare I hope for it) free? thank
-
When I am on the phone and another call beeps in, it doesn't give me caller ID. It also does not give me the option to swap the call. How can I fix this?
-
JNLP get external images ,ASAP
hello i have an application , my application is starting using JAVA WEB START inside a jetty server i have some images outside of my jar file , and i like to load thous images to my application how can i do that ? what path should i write to get the