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

Need a date calendar component #3104

Closed
geohuz opened this issue Jan 30, 2016 · 13 comments
Closed

Need a date calendar component #3104

geohuz opened this issue Jan 30, 2016 · 13 comments
Labels

Comments

@geohuz
Copy link

geohuz commented Jan 30, 2016

Basically It is just a calendar component with look and feel similar with the date picker. It's a calendar without "popup". Any way to make it?

@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 30, 2016

That's the internal Calendar component. You can use it directly but we plan do change the folder organization. That may break in the future.

@geohuz
Copy link
Author

geohuz commented Jan 31, 2016

Thanks!

@jaredmahan
Copy link

@oliviertassinari The link you specified no longer works

@oliviertassinari
Copy link
Member

@jaredmahan Link fixed.

@mokargas
Copy link

mokargas commented Oct 31, 2017

Hey, I'm trying to use the calendar directly, but all days appear on one line. Is there any other way to show the calendar persistently?

import Calendar from 'material-ui/DatePicker/Calendar';

export default class DateSelector extends React.Component {

  render() {
    return (

        <Calendar></Calendar>

    );
  }
}

@PhilipGrefe
Copy link

@mokargas look right here: #5037

@mokargas
Copy link

mokargas commented Nov 2, 2017

Thanks @felipesp !

@qalqi
Copy link

qalqi commented Jan 11, 2018

To capture day click events for
<Calendar firstDayOfWeek={1} onTouchTapDay={(event, date) => { console.log(date)}} ></Calendar>

@nataze
Copy link

nataze commented Feb 14, 2019

To capture day click events for
<Calendar firstDayOfWeek={1} onTouchTapDay={(event, date) => { console.log(date)}} ></Calendar>

For some reason the onTouchTapDay doesn't work for me, did it work for you @qalqi ?

@nataze
Copy link

nataze commented Feb 14, 2019

Nevermind, it was changed to onClickDay

@oliviertassinari oliviertassinari changed the title Need a calendar component Need a date calendar component Feb 14, 2019
@MattRCherry
Copy link

Hey does anyone still know if this is still possible? It looks like the folder organization was changed so the Calendar now lives under /views/Calendar, but when I try to render it, it now requires props I'm not sure what to do with. Here is what I've tried:

import React, { useState } from 'react';
import { MaterialUiPickersDate } from '@material-ui/pickers';
import { Calendar } from '@material-ui/pickers/views/Calendar/Calendar';
import { makeStyles } from '@material-ui/styles';
import { Theme, createStyles, useTheme } from '@material-ui/core';

const useStyles = makeStyles((theme: Theme) => createStyles({}));

interface ScheduleViewProps {
  example?: string;
}

export default function ScheduleView(props: ScheduleViewProps) {
  const { example } = props;
  const theme: Theme = useTheme();
  const [selectedDate, setSelectedDate] = useState<Date | null>(new Date());

  const handleDateChange = (date: MaterialUiPickersDate) => {
    setSelectedDate(date);
  };

  return (
    <div>
      <Calendar
        firstDayOfWeek={1}
        date={selectedDate}
        onChange={(date, isFinish) => {}}
        classes={{}}
        utils={{}}
        theme={theme}
      />
    </div>
  );
}

Left with the Typescript errors:
Prop classes:

Type '{}' is missing the following properties from type 'Record<"transitionContainer" | "progressContainer" | "week", string>': transitionContainer, progressContainer, week

Prop utils:

Type '{}' is missing the following properties from type 'IUtils<Date | null>': yearFormat, yearMonthFormat, dateTime12hFormat, dateTime24hFormat, and 50 more.

@oliviertassinari
Copy link
Member

@MattRCherry Do you think that you could move the concern to https://github.com/mui-org/material-ui-pickers? Thanks :)

@MattRCherry
Copy link

Will do! My mistake should have noticed this was no longer the right repo!

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

No branches or pull requests

8 participants