Skip to content

Commit

Permalink
Resolves #2, Fixes #3, added display improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rouftom committed May 1, 2022
1 parent 4a18302 commit bb1eb50
Show file tree
Hide file tree
Showing 30 changed files with 722 additions and 285 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ bower_components
build/Release

# Dependency directories
dist/
node_modules/
jspm_packages/

Expand Down Expand Up @@ -119,3 +120,4 @@ out
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
react-mui-scheduler-*
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ npm-debug.log
config.gypi
package-lock.json
.idea/
.travis.yml
.travis.yml
react-mui-scheduler-*
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [2.0.0] - 2022-05-01

### Added

- Add Internationalization. Languages availables are `ar`, `de`, `en`, `es`, `fr`, `ja`, `ko`, `zh`

- Resolves #2

### Changed

- Add new display style

### Fixed



## [1.2.6] - 2022-04-26

### Added
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 rouftom
Copyright (c) 2022 rouftom

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center"><a href="" target="_blank"><img align="center" src="public/month-mode-preview.png"></a></p>
<p align="center"><a href="" target="_blank"><img align="center" src="https://user-images.githubusercontent.com/12144793/166131609-62c6fa1d-c8fc-4147-8adc-78260836b94b.gif"></a></p>

<!-- ![month-mode-preview.png](public/month-mode-preview.png "Month mode preview") -->
<!-- ![month-mode-preview.png](https://user-images.githubusercontent.com/12144793/166131609-62c6fa1d-c8fc-4147-8adc-78260836b94b.gif "Month mode preview") -->

<h1 align="center">📅 React Material Scheduler</h1>
<p align="center">developed with <a target="_blank" href="https://mui.com">@mui v5</a> </p>
Expand Down Expand Up @@ -124,7 +124,9 @@ function App() {

return (
<Scheduler
locale="en"
events={events}
legacyStyle={false}
options={state?.options}
alertProps={state?.alertProps}
toolbarProps={state?.toolbarProps}
Expand Down Expand Up @@ -156,6 +158,23 @@ ReactDOM.render(<App />, document.querySelector('#yourComponentRootId'))
For more details about date formats, see [date-fns docs](https://date-fns.org/v2.24.0/docs/)
## Props
| Name | Type | Default | Description | Values |
|------ |--- |--- |--- |--- |
| locale | string | `en` | This prop is used to set the locale of the scheduler | `ar`, `de`, `en`, `es`, `fr`, `ja`, `ko`, `zh` |
| events | object | | This prop sets event data | |
| legacyStyle | boolean | `false` | This prop allows to use the old display style | `false`, `true` |
| options | object | | This prop is used to set scheduler properties | |
| alertProps | object | | This prop is used to set scheduler properties | |
| toolbarProps | object | | This prop is used to set toolbar properties | |
| onEventsChange | event | | This event is fired when the event change occurs | |
| onCellClick | event | | This event is fired when a cell is clicked | |
| onTaskClick | event | | This event is fired when a task is clicked | |
| onAlertCloseButtonClicked | event | | This event is fired when the close button of the alert component | |
## Options
| Name | Type | Default | Description | Values |
Expand Down Expand Up @@ -220,6 +239,8 @@ For more details about date formats, see [date-fns docs](https://date-fns.org/v2
Do you like this library ? Buy me a coffee or support me with a star on Github
<a href="https://www.buymeacoffee.com/Lnp9rkM" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
* Btc address: `bc1qettgagenn9nc8ks7ghntjfme96yvvkfhntk774`
* Eth address: `0xB0413d8D0336E263e289A915c383e152155881E0`
Expand All @@ -233,11 +254,11 @@ For more details about date formats, see [date-fns docs](https://date-fns.org/v2
- 👉 Export events as PDF and CSV
- 👉 Internationalization
- Internationalization
- 👉 Typescript support
- 👉 Theme customization
- ✅ Display style customization
## License
Expand All @@ -246,7 +267,7 @@ For more details about date formats, see [date-fns docs](https://date-fns.org/v2
MIT License
Copyright (c) 2021 rouftom
Copyright (c) 2022 rouftom
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
14 changes: 14 additions & 0 deletions locales/ar/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"day": "يوم",
"week": "أسبوع",
"month": "شهر",
"timeline": "الجدول الزمني",
"mon": "الإثنين",
"tue": "الثلاثاء",
"wed": "تزوج",
"thu": "خميس",
"fri": "الجمعة",
"sat": "قعد",
"sun": "شمس",
"search": "بحث"
}
3 changes: 3 additions & 0 deletions locales/dateFnsContext.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {createContext} from "react";
const DateFnsLocaleContext = createContext()
export default DateFnsLocaleContext
14 changes: 14 additions & 0 deletions locales/de/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"day": "Tag",
"week": "Woche",
"month": "Monat",
"timeline": "Zeitleiste",
"mon": "Mo",
"tue": "Diens",
"wed": "Mitt",
"thu": "Donner",
"fri": "Frei",
"sat": "Sam",
"sun": "Sonn",
"search": "Suchen..."
}
14 changes: 14 additions & 0 deletions locales/en/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"day": "Day",
"week": "Week",
"month": "Month",
"timeline": "Timeline",
"mon": "Mon",
"tue": "Tue",
"wed": "Wed",
"thu": "Thu",
"fri": "Fri",
"sat": "Sat",
"sun": "Sun",
"search": "Search..."
}
14 changes: 14 additions & 0 deletions locales/es/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"day": "Día",
"week": "Semana",
"month": "Mes",
"timeline": "Cronología",
"mon": "Lub",
"tue": "Mar",
"wed": "Mié",
"thu": "Jue",
"fri": "Vie",
"sat": "Sáb",
"sun": "Dom",
"search": "Buscar..."
}
14 changes: 14 additions & 0 deletions locales/fr/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"day": "Jour",
"week": "Semaine",
"month": "Mois",
"timeline": "Chronologie",
"mon": "Lun",
"tue": "Mar",
"wed": "Mer",
"thu": "Jeu",
"fri": "Ven",
"sat": "Sam",
"sun": "Dim",
"search": "Chercher..."
}
14 changes: 14 additions & 0 deletions locales/ja/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"day": "",
"week": "",
"month": "",
"timeline": "年表",
"mon": "月曜日",
"tue": "3月",
"wed": "",
"thu": "ゲーム",
"fri": "",
"sat": "",
"sun": "太陽",
"search": "探す..."
}
14 changes: 14 additions & 0 deletions locales/ko/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"day": "",
"week": "",
"month": "",
"timeline": "타임라인",
"mon": "",
"tue": "화요일",
"wed": "",
"thu": "",
"fri": "",
"sat": "앉았다",
"sun": "",
"search": "검색..."
}
43 changes: 43 additions & 0 deletions locales/locale.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import i18n from "i18next"
import { initReactI18next } from "react-i18next"

import trEN from "./en/common.json"
import trFR from "./fr/common.json"
import trKO from "./ko/common.json"
import trDE from "./de/common.json"
import trES from "./es/common.json"
import trAR from "./ar/common.json"
import trJA from "./ja/common.json"
import trZH from "./zh/common.json"

const resources = {
en: { common: trEN },
fr: { common: trFR },
ko: { common: trKO },
de: { common: trDE },
es: { common: trES },
ar: { common: trAR },
ja: { common: trJA },
zh: { common: trZH }
}

i18n
// pass the i18n instance to react-i18next.
.use(initReactI18next)
// init i18next
// for all options read: https://www.i18next.com/overview/configuration-options
.init({
resources,
lng: localStorage.getItem('i18nextLng'),
ns: ["common"],
defaultNS: "common",
fallbackNS: "common",
fallbackLng: ["en", "fr", "dev"],
debug: false,
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
react: { wait: true },
})

export default i18n
14 changes: 14 additions & 0 deletions locales/zh/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"day": "",
"week": "星期",
"month": "",
"timeline": "年表",
"mon": "星期一",
"tue": "三月",
"wed": "",
"thu": "游戏",
"fri": "周五",
"sat": "星期六",
"sun": "太阳",
"search": "寻找..."
}
Loading

0 comments on commit bb1eb50

Please sign in to comment.