Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide one common class for the current date range #23

Open
alanmels opened this issue Sep 4, 2023 · 2 comments
Open

Provide one common class for the current date range #23

alanmels opened this issue Sep 4, 2023 · 2 comments

Comments

@alanmels
Copy link
Member

alanmels commented Sep 4, 2023

To highlight the date range containing the current date, I used the "starts-today" class shown on the html code below:

<td class="multi-day starts-today" colspan="2" rowspan="1" data-date="2023-09-03" >
  <div class="inner">
    <div class="item">
  <div class="view-item view-item-calendar ">
  <div class="calendar monthview">
        <div class="calendar-21-field_check_in-0.2 contents">
                      <div class="continuation">&laquo;</div>
                Logan [blurred]                      <a href="/reservation/4/hmsny3xb9p" class="active">HMSNY3XB9P</a>          </div>
        <div class="cutoff">&nbsp;</div>
      </div>
  </div>

and it works great when the current day is within the date range that is displayed in one row within the same <tr>, however when the date range is broken down into two parts then the styling also breaks like so:

calendar

The closest template I could use to get to rows (not fields) was the template_preprocess_calendar_month and the part that was not working for me where I injected a new class for styling purposes looks like this:

<td class="multi-day" colspan="2" rowspan="1" data-date="2023-09-01" >
  <div class="inner">
    <div class="item">
  <div class="view-item view-item-calendar ">
  <div class="calendar monthview">
        <div class="calendar-21-field_check_in-0.0 contents">
                      <div class="continuation">&laquo;</div>
                Logan [blurred]                       <a href="/reservation/4/hmsny3xb9p" class="active">HMSNY3XB9P</a>          </div>
        <div class="continues">&raquo;</div>
      </div>
  </div>
</div>
  </div>
</td>

but it was quite a "dirty" hack, so I thought to report this issue in hope that module maintainers could come up with better solution. Thanks for consideration!

@herbdool
Copy link
Contributor

Thanks @alanmels for reporting. I won't be able to spend much time on this, but if you've got chance to make a PR, I can test and review.

@alanmels
Copy link
Member Author

Well, I would definitely file a PR if I knew how to come up with more generic approach that would work for everybody else. In my use case, as I explained, I had to use "quite dirty" hack that won't work for other users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants