Oracle Apex-如何根据当前日期更改日历条目的颜色?

发布于 2025-02-12 04:37:14 字数 1114 浏览 0 评论 0原文

我在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文