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
innerHeight to the bottom #276
Comments
I will add this feature to the upcoming versions |
This will help a lot for dynamic screen sizes and for users who change their browser window. |
landed in |
show me |
BTW if you are using |
function onCellCreate({ row, time, vido }) {
let className = "gray";
if (
time.rightGlobal <
time.rightGlobalDate.startOf("day").add(8, "hour").valueOf()
) {
// before 8:00 AM
className = "green";
}
if (
time.leftGlobal.valueOf() >=
time.leftGlobalDate.startOf("day").add(17, "hour").valueOf()
) {
// after 12:00 AM
className = "green";
}
return vido.html`<div class="${className}"></div>`;
} function itemSlot(vido, props) {
const { onChange, update, html, api, getElement } = vido;
// Get element and initialize tippy instance
let element, tippyInstance;
function initialize(el) {
element = el;
// @ts-ignore
if (!tippyInstance)
tippyInstance = tippy(element, {
trigger: "mouseenter click",
interactive: true,
animation: true,
allowHTML: true,
placement: "top",
appendTo: document.body,
popperOptions: {
modifiers: {
flip: {
boundariesElement: "scrollParent",
},
},
}
});
}
let itemData, startDate, endDate, tooltipContent;
const formatDate = (date) => {
var d = new Date(date);
var hour = d.getHours();
var minute = d.getMinutes();
var second = d.getSeconds();
hour = hour < 10 ? "0" + hour : hour;
minute = minute < 10 ? "0" + minute : minute;
second = second < 10 ? "0" + second : second;
return (
// In case you want the day too, just uncomment this
/* d.getUTCFullYear() +
"/" +
(d.getUTCMonth() + 1) +
"/" +
d.getUTCDate() +
" " +*/
hour + ":" + minute + ":" + second
);
};
onChange((newProps) => {
startDate = props = newProps;
if (!props || !props.item) return;
itemData = api.getItemData(props.item.id);
if (!itemData) return;
startDate = itemData.time.startDate;
endDate = itemData.time.endDate;
tooltipContent = `From ${formatDate(
props.item.time.start
)} to ${formatDate(props.item.time.end)}`;
// render the view and after that set tippy content
update(() => {
tippyInstance.setContent(tooltipContent);
});
});
return (content) =>
html`<div
directive=${getElement(initialize)}
class="my-item"
style="width:100%;display:flex;"
>
${content}
</div>`;
} Calendar levels has te following arrays const hours = [
{
zoomTo: 100, // we want to display this format for all zoom levels until 100
period: "day",
periodIncrement: 1,
format({ timeStart }) {
var days = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
];
var d = new Date(timeStart);
return days[d.getDay()] + " - " + timeStart.format("MMMM DD, YYYY"); // full list of formats: https://day.js.org/docs/en/display/format
},
},
]; const minutes = [
{
zoomTo: 12,
period: "minute",
periodIncrement: 5,
main: true,
format({ timeStart, vido }) {
return vido.html`<div style="text-align:center;">${timeStart.format(
"hh:mm A"
)}</div>`;
},
},
{
zoomTo: 13,
period: "minute",
periodIncrement: 10,
main: true,
format({ timeStart, vido }) {
return vido.html`<div style="text-align:center;">${timeStart.format(
"hh:mm A"
)}</div>`;
},
},
{
zoomTo: 13.9,
period: "minute",
periodIncrement: 15,
main: true,
format({ timeStart, vido }) {
return vido.html`<div style="text-align:center;">${timeStart.format(
"hh:mm A"
)}</div>`;
},
},
{
zoomTo: 14,
period: "minute",
periodIncrement: 20,
main: true,
format({ timeStart, vido }) {
return vido.html`<div style="text-align:center;">${timeStart.format(
"hh:mm A"
)}</div>`;
},
},
{
zoomTo: 14.5,
period: "minute",
periodIncrement: 30,
main: true,
format({ timeStart, vido }) {
return vido.html`<div style="text-align:center;">${timeStart.format(
"hh:mm A"
)}</div>`;
},
},
{
zoomTo: 15.5,
period: "hour",
periodIncrement: 1,
main: true,
format({ timeStart, vido }) {
return vido.html`<div style="text-align:center;">${timeStart.format(
"hh:mm A"
)}</div>`;
},
},
{
zoomTo: 16.5,
period: "hour",
periodIncrement: 2,
main: true,
format({ timeStart, vido }) {
return vido.html`<div style="text-align:center;">${timeStart.format(
"hh:mm A"
)}</div>`;
},
},
{
zoomTo: 17.5,
period: "hour",
periodIncrement: 4,
main: true,
format({ timeStart, vido }) {
return vido.html`<div style="text-align:center;">${timeStart.format(
"hh:mm A"
)}</div>`;
},
},
{
zoomTo: 100,
period: "minute",
periodIncrement: 60,
main: true,
format({ timeStart, vido }) {
return vido.html`<div style="text-align:center;">${timeStart.format(
"hh:mm A"
)}</div>`;
},
},
]; ``` |
Ok thanks, I didn't know |
fixed in |
|
Ah ok thank you very much |
Is there a way to put this property in something like "auto", without having to put the height in pixels? That way it will be helpful for different screen sizes
The text was updated successfully, but these errors were encountered: