Oracle Apex-如何根据当前日期更改日历条目的颜色?
我在Apex中创建了一个预订日历,在其中写下了本周预订,每种预订类型都有自己的颜色。现在,我想确保预订结束日期通过当前日期时,日历条目将颜色变为灰色。
这是我的SQL查询:
select ID_REZ,
POCETAK_REZ,
KRAJ_REZ,/* This is the end date!*/
NASLOV_REZ,
case when NASLOV_REZ is not null then
title || '(' || BR_OSOBA_REZ || ' x ' || NAZIV_USLUGE || ' na ' || BR_SATI_REZ || ' sata. Detalji: ' || NASLOV_REZ || ' )' || '[Šifra rezervacije: '|| ID_REZ ||']'
end as title,
BR_OSOBA_REZ,
BR_SATI_REZ,
case
when USLUGA_FK = 13 then 'apex-cal-red'
when USLUGA_FK = 14 then 'apex-cal-orange'
when USLUGA_FK = 15 then 'apex-cal-blue'
when USLUGA_FK = 16 then 'apex-cal-green'
when USLUGA_FK = 17 then 'apex-cal-lime'
when KRAJ_REZ < CURRENT_DATE then 'apex-cal-grey'
end as CSS_REZ /* This is where i store my colors for each entry*/
from REZERVACIJE
JOIN USLUGA ON USLUGA_FK = ID_USLUGA
where
(nvl(:VRSTA_USLUGE,'0') = '0' or USLUGA_FK = :VRSTA_USLUGE)
order by POCETAK_REZ
这有点不起作用,所以我对任何建议都开放!
PS:我的理论是,不幸的是,当语句与至少1个颜色重叠时,最后一个,因此第一种通过语句“赢” 的颜色CSS_REZ列。
但是我的大脑现在无法解决如何修复它,请提供帮助!
I created a reservation calendar in Apex where I write down reservations for the week and every reservation type has its own color. Now I want to make sure that when a reservation end date passed the current date that the calendar entry changes color to grey.
This is my SQL query:
select ID_REZ,
POCETAK_REZ,
KRAJ_REZ,/* This is the end date!*/
NASLOV_REZ,
case when NASLOV_REZ is not null then
title || '(' || BR_OSOBA_REZ || ' x ' || NAZIV_USLUGE || ' na ' || BR_SATI_REZ || ' sata. Detalji: ' || NASLOV_REZ || ' )' || '[Šifra rezervacije: '|| ID_REZ ||']'
end as title,
BR_OSOBA_REZ,
BR_SATI_REZ,
case
when USLUGA_FK = 13 then 'apex-cal-red'
when USLUGA_FK = 14 then 'apex-cal-orange'
when USLUGA_FK = 15 then 'apex-cal-blue'
when USLUGA_FK = 16 then 'apex-cal-green'
when USLUGA_FK = 17 then 'apex-cal-lime'
when KRAJ_REZ < CURRENT_DATE then 'apex-cal-grey'
end as CSS_REZ /* This is where i store my colors for each entry*/
from REZERVACIJE
JOIN USLUGA ON USLUGA_FK = ID_USLUGA
where
(nvl(:VRSTA_USLUGE,'0') = '0' or USLUGA_FK = :VRSTA_USLUGE)
order by POCETAK_REZ
This kinda doesn't work so I'm open to any suggestions!
PS: My theory is that unfortunately, this last when
statement is overlapping with at least 1 more color change so the first color that passes the WHEN
statement "wins" the place in the CSS_REZ column.
But my brain doesn't work now on how to fix it please help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论