Skip to content

how can i provide minimun fixedwidth for date so that i can mention another values with date also like count for that date etc #915

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

Closed
premiumash25Aug opened this issue Aug 30, 2023 · 1 comment

Comments

@premiumash25Aug
Copy link

        <DateHeader unit="any" labelFormat= "MMMM" intervalRenderer={intervalRenderer} headerData={{ isMonth: true, currenDate: new Date()

i am using above to get count but i am unable to change size of that componenet as its overflowing
const intervalRenderer = ({ intervalContext, getIntervalProps, data, ...rest }) => {
const { interval } = intervalContext;
const { startTime, endTime } = interval;
const count = bookedCountPerDay(startTime);

return (
  <div
    {...getIntervalProps()}
    className={`rct-dateHeader ${data.isMonth ? "rct-dateHeader-primary" : ""

      }`}

    onClick={() => {
      return false;
    }}
  >
    <span
      style={{
        position: data.isMonth ? "sticky" : "static",
        marginRight: data.isMonth ? "auto" : "inherit",
        left: 10,
        padding: "0 5px",
        fontWeight: "bold",
        width: "100%",
        height: "100%",
        display: "flex",

        color: data.isMonth ? "white" : "black",
      }}
    >
      {count} "This is count"
    </span>
  </div>
);

};

@premiumash25Aug premiumash25Aug changed the title how can i provide minimun mixed width for date so that i can mention another values with date also like count for that date etc how can i provide minimun fixedwidth for date so that i can mention another values with date also like count for that date etc Aug 30, 2023
@premiumash25Aug
Copy link
Author

resolved via css but item renderer put <DateHeader
height={100}
intervalRenderer={intervalRenderer}
unit="day"
labelFormat="DD"
headerData={{
currentUnit: currentUnit,
visibleTimeStart: visibleTimeStart,
visibleTimeEnd: visibleTimeEnd
}}
/> const intervalRenderer = useIntervalRendererMemo(
({ getIntervalProps, intervalContext, data }) => {
const { interval } = intervalContext;
const { startTime } = interval;
let countItem = cardCountList.find(item => item.date === moment(startTime).format("YYYY-MM-DD"));
if (!countItem) {
return;
}
else {
const containerStyle = {
display: "flex",
justifyContent: "center",
alignItems: "center",
height: "100%",
};
const intervalStyle = {
backgroundColor: countItem ? "aqua" : "black",
};

    return (
      <div {...getIntervalProps()} style={intervalStyle} id={countItem ? "countItem" : "noCountItem"} className="booking-card" >
        <div style={containerStyle}>
          <div style={{ marginRight: "auto" }}>
            <strong>{moment(startTime).format("ddd D-MMM")}</strong>
            <label style={{ display: "block" }}>
              Booked : {countItem ? countItem.count : 0}
            </label>
            <label style={{ display: "block" }}>
              Wait List : 0
            </label>
          </div>
        </div>
      </div>
    );
  }
},
[cardCountList]

); but it puts extra memory pressure on ui

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

No branches or pull requests

1 participant