├── src ├── .prettierignore ├── react-app-env.d.ts ├── setupTests.ts ├── reportWebVitals.ts ├── components │ ├── ExamSlot │ │ ├── ExamSlot.scss │ │ └── ExamSlot.tsx │ ├── SettingsClasses │ │ ├── SettingsClasses.scss │ │ └── SettingsClasses.tsx │ ├── PasteMail │ │ ├── PasteMail.scss │ │ └── PasteMail.tsx │ ├── Notif │ │ ├── Notif.tsx │ │ └── Notif.scss │ ├── index.js │ ├── SettingsExams │ │ ├── SettingsExams.scss │ │ └── SettingsExams.tsx │ ├── SettingsExam │ │ ├── SettingsExam.scss │ │ └── SettingsExam.tsx │ ├── SettingsClass │ │ ├── SettingsClass.scss │ │ └── SettingsClass.tsx │ ├── ClassSlot │ │ ├── ClassSlot.scss │ │ └── ClassSlot.tsx │ ├── SettingsSemester │ │ ├── SettingsSemester.scss │ │ └── SettingsSemester.tsx │ ├── Settings │ │ ├── Settings.scss │ │ └── Settings.tsx │ └── Calendar │ │ └── Calendar.scss ├── types │ ├── weekAlternance.d.ts │ ├── notifType.d.ts │ ├── _index.js │ └── classColor.d.ts ├── data │ ├── index.js │ ├── allColors.ts │ ├── getP24organization.ts │ ├── getA23organization.ts │ ├── getA22organization.ts │ ├── getP23organization.ts │ ├── getA25organization.ts │ ├── getA24organization.ts │ └── getP25organization.ts ├── utils │ ├── printDate.ts │ ├── isKifyAccepted.ts │ ├── daysIndex.ts │ ├── getDayLabel.ts │ ├── loadFromLocalStorage.ts │ ├── getMonday.ts │ ├── moveDate.ts │ ├── saveFile.ts │ ├── saveToCache.ts │ ├── parseExamsMail.ts │ ├── parseClassesDay.ts │ ├── parseClassesMail.ts │ ├── parseCache.ts │ ├── parseExamsLine.ts │ ├── index.js │ ├── DaySemesterOrganization.ts │ ├── Exam.ts │ ├── parseClassesLine.ts │ ├── SemesterPlanning.ts │ ├── parseSemester.ts │ ├── Class.ts │ └── toICS.ts ├── App.test.tsx ├── App.css ├── index.css ├── index.tsx ├── logo.svg └── App.tsx ├── .github └── FUNDING.yml ├── public ├── robots.txt ├── favicon.ico ├── logo192.png ├── logo512.png ├── manifest.json └── index.html ├── .prettierrc.json ├── .gitignore ├── tsconfig.json ├── LICENSE ├── README.md └── package.json /src/.prettierignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | # Ignore artifacts: 3 | build -------------------------------------------------------------------------------- /src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://www.paypal.com/paypalme/StephaneBranly 2 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephaneBranly/ur-time-calendar/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephaneBranly/ur-time-calendar/HEAD/public/logo192.png -------------------------------------------------------------------------------- /public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/StephaneBranly/ur-time-calendar/HEAD/public/logo512.png -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "trailingComma": "es5", 3 | "tabWidth": 4, 4 | "semi": false, 5 | "singleQuote": true 6 | } 7 | -------------------------------------------------------------------------------- /src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom' 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals' 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then( 6 | ({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 7 | getCLS(onPerfEntry) 8 | getFID(onPerfEntry) 9 | getFCP(onPerfEntry) 10 | getLCP(onPerfEntry) 11 | getTTFB(onPerfEntry) 12 | } 13 | ) 14 | } 15 | } 16 | 17 | export default reportWebVitals 18 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "baseUrl": "./src/", 6 | "allowJs": true, 7 | "skipLibCheck": true, 8 | "esModuleInterop": true, 9 | "allowSyntheticDefaultImports": true, 10 | "strict": true, 11 | "forceConsistentCasingInFileNames": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "module": "esnext", 14 | "moduleResolution": "node", 15 | "resolveJsonModule": true, 16 | "isolatedModules": true, 17 | "noEmit": true, 18 | "jsx": "react-jsx" 19 | }, 20 | "include": ["src"] 21 | } 22 | -------------------------------------------------------------------------------- /public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "Ur Time Calendar", 3 | "name": "Ur Time Calendar", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /src/components/ExamSlot/ExamSlot.scss: -------------------------------------------------------------------------------- 1 | .exam-slot { 2 | background-image: linear-gradient(90deg, #fc354c 0%, #bf0a0a 100%); 3 | box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2); 4 | border-radius: 5px; 5 | position: relative; 6 | z-index: 15; 7 | display: flex; 8 | flex-direction: column; 9 | overflow: hidden; 10 | box-sizing: border-box; 11 | &.selected { 12 | position: absolute; 13 | top: 0; 14 | left: 0; 15 | right: 0; 16 | min-height: 100%; 17 | box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.5); 18 | z-index: 25; 19 | } 20 | 21 | 22 | } 23 | .exam-slot-uvname { 24 | background-color: rgba(0, 0, 0, 0.5); 25 | color: white; 26 | padding: 5px; 27 | border-radius: 3px; 28 | display: inline-block; 29 | } 30 | .exam-slot-place { 31 | text-align: left; 32 | padding: 5px; 33 | color: black; 34 | } 35 | .exam-slot-time { 36 | color: #444; 37 | } 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Stephane_Branly 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ur-time-calendar 2 | 3 | Load your schedule from the SME's email, see it with a nice interface and Keep It For You ! 4 | 5 | Available at [this link](https://stephanebranly.github.io/ur-time-calendar/) 6 | 7 | 🍻 Send messages and say thanks to the author with a [paypal](https://www.paypal.com/paypalme/StephaneBranly) transaction 🍻 8 | 9 | Made with ❤️ by branlyst (Stéphane BRANLY) 10 | 11 | ## To update the semester organization 12 | 13 | 1. Fork the project [Fork a repo doc](https://docs.github.com/en/get-started/quickstart/fork-a-repo) 14 | 2. Create a new semester organization file like [getP23organization](./src/data/getP23organization.ts) 15 | 3. Fill it with the right semester organization by following rules : 16 | - Use date intervals 17 | - Intervals cannot be on 2 different months 18 | - Intervals cannot overlap 19 | - The intervals are of the following format: 20 | `YEAR/MM/DD-YEAR/MM/DD-W-S-R` 21 | - `YEAR/MM/DD-YEAR/MM/DD` With the first date corresponding to the start date of the interval, and the second the end date included in the interval. 22 | - `W: 'A' | 'B' | 'x' ` Alternating week 23 | - `S: 'M' | 'F' | 'C' | 'H' | 'x'` Special day label (Median, Final, Congé/Férié, Holiday) 24 | - `R: 'Lundi' | 'Mardi' | 'Mercredi' | 'Jeudi' | 'Vendredi' | 'Samedi' | 'x'` Replacement day 25 | - In [App.tsx](./src/App.tsx), import and set the right semester organization state 26 | - Check everything is working 27 | - Create a pull request which will be merged in the reference repository 28 | -------------------------------------------------------------------------------- /src/types/weekAlternance.d.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* weekAlternance.d.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/08/12 15:16:53 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | export type weekAlternance = 'A' | 'B' | undefined 16 | -------------------------------------------------------------------------------- /src/types/notifType.d.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* notifType.d.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 22:26:57 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | export type notifType = 'success' | 'error' | 'warning' | 'info' | undefined -------------------------------------------------------------------------------- /src/data/index.js: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* index.js :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 23:31:28 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import getA22organization from './getA22organization' 16 | export { getA22organization } 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "urtimecalendar", 3 | "version": "0.1.0", 4 | "homepage": "https://stephanebranly.github.io/ur-time-calendar/", 5 | "dependencies": { 6 | "@testing-library/jest-dom": "^5.16.2", 7 | "@testing-library/react": "^12.1.3", 8 | "@testing-library/user-event": "^13.5.0", 9 | "@types/jest": "^27.4.1", 10 | "@types/node": "^16.11.26", 11 | "@types/react": "^17.0.39", 12 | "@types/react-dom": "^17.0.11", 13 | "gh-pages": "^3.2.3", 14 | "react": "^17.0.2", 15 | "react-device-detect": "^2.2.2", 16 | "react-dom": "^17.0.2", 17 | "react-icons": "^4.3.1", 18 | "react-scripts": "5.0.0", 19 | "sass": "^1.49.8", 20 | "typescript": "^4.5.5", 21 | "urtimecalendar": "file:", 22 | "uuid": "^9.0.0", 23 | "web-vitals": "^2.1.4" 24 | }, 25 | "scripts": { 26 | "start": "react-scripts start", 27 | "build": "react-scripts build", 28 | "test": "react-scripts test", 29 | "eject": "react-scripts eject", 30 | "predeploy": "npm run build", 31 | "deploy": "gh-pages -d build" 32 | }, 33 | "eslintConfig": { 34 | "extends": [ 35 | "react-app", 36 | "react-app/jest" 37 | ] 38 | }, 39 | "browserslist": { 40 | "production": [ 41 | ">0.2%", 42 | "not dead", 43 | "not op_mini all" 44 | ], 45 | "development": [ 46 | "last 1 chrome version", 47 | "last 1 firefox version", 48 | "last 1 safari version" 49 | ] 50 | }, 51 | "devDependencies": { 52 | "@types/uuid": "^8.3.4", 53 | "prettier": "^2.5.1" 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/types/_index.js: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* index.js :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/08/12 15:22:08 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | // import weekAlternance from './weekAlternance' 16 | // import classColor from './classColor' 17 | 18 | // export {weekAlternance, classColor} 19 | -------------------------------------------------------------------------------- /src/utils/printDate.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* printDate.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 13:33:58 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | const printDate = (date: Date): string => { 16 | return `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}` 17 | } 18 | 19 | export default printDate -------------------------------------------------------------------------------- /src/utils/isKifyAccepted.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* isKifyAccepted.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/08/21 14:30:05 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | const isKifyAccepted = (): boolean => { 16 | return localStorage.getItem('kify_accepted') && localStorage.getItem('kify_accepted') === 'true' ? true : false 17 | } 18 | 19 | export default isKifyAccepted -------------------------------------------------------------------------------- /src/utils/daysIndex.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* daysIndex.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/02/25 01:10:01 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | const daysIndex: Record = { 16 | LUNDI: 0, 17 | MARDI: 1, 18 | MERCREDI: 2, 19 | JEUDI: 3, 20 | VENDREDI: 4, 21 | SAMEDI: 5, 22 | DIMANCHE: 6, 23 | } 24 | 25 | export default daysIndex 26 | -------------------------------------------------------------------------------- /src/data/allColors.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* allColors.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 23:13:14 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | const allColors = ['lagon', 'starfall', 'orange-coral', 'sulfur', 'barbapapa', 'cool-blues', 'amethyst', 'park-life', 'cherryblossoms', 'reef', 'candy', 'nelson', 'almost', 'miaka', 'calm-darya', 'juicy-orange'] 16 | 17 | export default allColors -------------------------------------------------------------------------------- /src/types/classColor.d.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* classColor.d.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 23:11:59 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | export type classColor = 'lagon' | 'starfall' | 'orange-coral' | 'sulfur' | 'barbapapa' | 'cool-blues' | 'amethyst' | 'park-life' | 'cherryblossoms' | 'reef' | 'candy' | 'nelson' | 'almost' | 'miaka' | 'calm-darya' | 'juicy-orange' | undefined 16 | -------------------------------------------------------------------------------- /src/utils/getDayLabel.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* getDayLabel.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/03/08 17:39:58 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | const getDayLabel = (date: Date) => { 16 | var stringDayName = date.toLocaleDateString('fr-FR', { 17 | weekday: 'long', 18 | }) 19 | return stringDayName[0].toUpperCase() + stringDayName.slice(1) 20 | } 21 | 22 | export default getDayLabel 23 | -------------------------------------------------------------------------------- /src/utils/loadFromLocalStorage.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* loadFromLocalStorage.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/10 22:07:47 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import isKifyAccepted from "./isKifyAccepted" 16 | 17 | const loadFromLocalStorage = (key: string): string | null => { 18 | if (!isKifyAccepted()) 19 | return null 20 | return localStorage.getItem(key) 21 | } 22 | 23 | export default loadFromLocalStorage -------------------------------------------------------------------------------- /src/utils/getMonday.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* getMonday.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/03/08 17:30:40 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | const getMonday = (date: Date) => { 16 | date = new Date(date) 17 | var day = date.getDay(), 18 | diff = date.getDate() - day + (day === 0 ? -6 : 1) // adjust when day is sunday 19 | return new Date(date.setDate(diff)) 20 | } 21 | 22 | export default getMonday 23 | -------------------------------------------------------------------------------- /src/utils/moveDate.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* moveDate.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/03/08 17:59:39 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | const moveDate = (date: Date, index: -1 | 1 | number, week = false): Date => { 16 | const delta = week ? index * 7 : index 17 | const newDate = new Date(date) 18 | newDate.setDate(newDate.getDate() + delta) 19 | return newDate 20 | } 21 | 22 | export default moveDate 23 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | Ur Time Calendar 28 | 29 | 30 | 31 |
32 | 42 | 43 | -------------------------------------------------------------------------------- /src/App.test.tsx: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* App.test.tsx :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/02/25 01:10:01 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import React from 'react' 16 | import { render, screen } from '@testing-library/react' 17 | import App from './App' 18 | 19 | test('renders learn react link', () => { 20 | render() 21 | const linkElement = screen.getByText(/learn react/i) 22 | expect(linkElement).toBeInTheDocument() 23 | }) 24 | -------------------------------------------------------------------------------- /src/utils/saveFile.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* saveFile.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/09/09 19:09:39 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | const saveFile = (filename: string, data: string) => { 16 | const blob = new Blob([data], {type: 'text/plain'}) 17 | const link = document.createElement('a') 18 | link.href = window.URL.createObjectURL(blob) 19 | link.download = filename 20 | link.click() 21 | } 22 | 23 | export default saveFile -------------------------------------------------------------------------------- /src/components/SettingsClasses/SettingsClasses.scss: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* SettingsClasses.scss :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 23:39:44 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | .settings-all-classes { 16 | display: grid; 17 | grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 18 | grid-gap: 20px; 19 | margin-bottom: 10px; 20 | } 21 | 22 | 23 | @media (max-width: 480px) { 24 | .settings-all-classes { 25 | grid-gap: 5px; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/utils/saveToCache.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* saveToCache.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 22:30:21 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import isKifyAccepted from "./isKifyAccepted" 16 | 17 | const saveToCache = (content: string, path: string) => { 18 | if (!isKifyAccepted()) 19 | return false 20 | 21 | localStorage.setItem(path, content) 22 | console.log(`[KIFY] Saved ${path} to cache.`) 23 | return true 24 | } 25 | 26 | export default saveToCache -------------------------------------------------------------------------------- /src/components/PasteMail/PasteMail.scss: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* PasteMail.scss :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/02/25 21:36:01 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | .pastemail { 16 | display: flex; 17 | align-items: stretch; 18 | align-content: stretch; 19 | flex-direction: column; 20 | } 21 | .pastemail-textarea { 22 | background-color: rgba(0, 0, 0, 0.2); 23 | border: 0px solid rgba(0, 0, 0, 0); 24 | min-height: 200px; 25 | max-height: 200px; 26 | width: 100%; 27 | min-width: 100%; 28 | max-width: 100%; 29 | } 30 | -------------------------------------------------------------------------------- /src/utils/parseExamsMail.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* parseExamsMail.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 11:08:24 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { Exam } from 'utils' 16 | import parseExamsLine from './parseExamsLine' 17 | 18 | const parseClassesMail = (content: string): Exam[] => { 19 | const lines = content.split('\n') 20 | const exams: Exam[] = [] 21 | lines.forEach((line) => { 22 | const result = parseExamsLine(line, 'final') 23 | if (result) { 24 | exams.push(result) 25 | } 26 | }) 27 | 28 | return exams 29 | } 30 | 31 | export default parseClassesMail 32 | -------------------------------------------------------------------------------- /src/App.css: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* App.css :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/10 22:05:42 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | .App { 16 | text-align: center; 17 | overflow: hidden; 18 | height: 100vh; 19 | width: 100vw; 20 | font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 21 | 'Lucida Sans', Arial, sans-serif; 22 | } 23 | 24 | .calendar-container { 25 | display: grid; 26 | align-items: center; 27 | vertical-align: center; 28 | justify-content: center; 29 | position: absolute; 30 | top: 0; 31 | bottom: 0; 32 | left: 0; 33 | right: 0; 34 | } 35 | -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* index.css :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/11 22:32:39 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | body { 16 | margin: 0; 17 | font-family: 'Arial', -apple-system, BlinkMacSystemFont, 'Segoe UI', 18 | 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 19 | 'Helvetica Neue', sans-serif; 20 | -webkit-font-smoothing: antialiased; 21 | -moz-osx-font-smoothing: grayscale; 22 | background-color: #dddddd; 23 | height: 100vh; 24 | } 25 | 26 | code { 27 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 28 | monospace; 29 | } 30 | -------------------------------------------------------------------------------- /src/utils/parseClassesDay.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* parseDay.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 10:44:48 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | const parseClassesDay = (day: string): string | undefined => { 16 | const dayUpper = day.toUpperCase() 17 | if (dayUpper.includes('LUN')) return 'LUNDI' 18 | if (dayUpper.includes('MAR')) return 'MARDI' 19 | if (dayUpper.includes('MER')) return 'MERCREDI' 20 | if (dayUpper.includes('JEU')) return 'JEUDI' 21 | if (dayUpper.includes('VEN')) return 'VENDREDI' 22 | if (dayUpper.includes('SAM')) return 'SAMEDI' 23 | return undefined 24 | } 25 | 26 | export default parseClassesDay 27 | -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* index.tsx :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/02/25 01:10:01 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import React from 'react' 16 | import ReactDOM from 'react-dom' 17 | import './index.css' 18 | import App from './App' 19 | import reportWebVitals from './reportWebVitals' 20 | 21 | ReactDOM.render( 22 | 23 | 24 | , 25 | document.getElementById('root') 26 | ) 27 | 28 | // If you want to start measuring performance in your app, pass a function 29 | // to log results (for example: reportWebVitals(console.log)) 30 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 31 | reportWebVitals() 32 | -------------------------------------------------------------------------------- /src/components/Notif/Notif.tsx: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* Notif.tsx :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 22:34:06 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { notifType } from 'types/notifType' 16 | import './Notif.scss' 17 | 18 | export interface NotifProps { 19 | setOpen: (open: boolean) => void 20 | isOpen: boolean 21 | notif?: [string, notifType] 22 | } 23 | 24 | const Notif = (props: NotifProps) => { 25 | const { setOpen, isOpen, notif } = props 26 | 27 | if (!isOpen || !notif) 28 | return null 29 | return ( 30 |
setOpen(false)}> 31 | {notif[0]} 32 |
33 | ) 34 | } 35 | 36 | export default Notif 37 | -------------------------------------------------------------------------------- /src/utils/parseClassesMail.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* parseMail.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 10:44:48 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { classColor } from 'types/classColor' 16 | import { Class, parseClassesLine } from 'utils' 17 | 18 | const parseClassesMail = (content: string): Class[] => { 19 | const lines = content.split('\n') 20 | const classes: Class[] = [] 21 | const uvsColors: Record = {} 22 | lines.forEach((line) => { 23 | const results = parseClassesLine(line, uvsColors) 24 | if (results) { 25 | classes.push(...results) 26 | if (!(results[0].UVname in uvsColors)) { 27 | uvsColors[results[0].UVname] = results[0].color 28 | } 29 | } 30 | }) 31 | 32 | return classes 33 | } 34 | 35 | export default parseClassesMail 36 | -------------------------------------------------------------------------------- /src/components/index.js: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* index.js :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 12:49:24 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import PasteMail from './PasteMail/PasteMail' 16 | import Calendar from './Calendar/Calendar' 17 | import Settings from './Settings/Settings' 18 | import ClassSlot from './ClassSlot/ClassSlot' 19 | import ExamSlot from './ExamSlot/ExamSlot' 20 | import SettingsClasses from './SettingsClasses/SettingsClasses' 21 | import SettingsClass from './SettingsClass/SettingsClass' 22 | import SettingsSemester from './SettingsSemester/SettingsSemester' 23 | import SettingsExams from './SettingsExams/SettingsExams' 24 | import SettingsExam from './SettingsExam/SettingsExam' 25 | import Notif from './Notif/Notif' 26 | export { PasteMail, Calendar, Settings, ClassSlot, SettingsClasses, SettingsClass, SettingsSemester, SettingsExams, SettingsExam, Notif, ExamSlot } 27 | -------------------------------------------------------------------------------- /src/components/Notif/Notif.scss: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* Notif.scss :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 22:34:20 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | .notif { 16 | position: absolute; 17 | top: 10px; 18 | right: 0; 19 | z-index: 100; 20 | border-radius: 10px 0 0 10px; 21 | box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.2); 22 | background-color: #fdfdfd; 23 | overflow: hidden; 24 | display: flex; 25 | flex-direction: column; 26 | justify-content: stretch; 27 | align-items: stretch; 28 | align-content: stretch; 29 | row-gap: 10px; 30 | padding: 10px; 31 | &.hidden { 32 | display: none; 33 | } 34 | &.success { 35 | color: #32a332; 36 | } 37 | &.error { 38 | color: #ba1c1c; 39 | } 40 | &.warning { 41 | color: #dca51a; 42 | } 43 | &.info { 44 | color: #1f79d4; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/components/SettingsExams/SettingsExams.scss: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* SettingsExams.scss :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 14:38:45 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | .settings-all-exams { 16 | display: grid; 17 | grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 18 | grid-gap: 20px; 19 | margin-bottom: 10px; 20 | margin-top: 10px; 21 | } 22 | 23 | .pastemail_exams { 24 | display: flex; 25 | align-items: stretch; 26 | align-content: stretch; 27 | flex-direction: column; 28 | } 29 | .pastemail_exams-textarea { 30 | background-color: rgba(0, 0, 0, 0.2); 31 | border: 0px solid rgba(0, 0, 0, 0); 32 | min-height: 200px; 33 | max-height: 200px; 34 | width: 100%; 35 | min-width: 100%; 36 | max-width: 100%; 37 | margin-bottom: 10px; 38 | } 39 | 40 | @media (max-width: 480px) { 41 | .settings-all-exams { 42 | grid-gap: 5px; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/components/SettingsExam/SettingsExam.scss: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* SettingsExam.scss :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 13:22:20 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | .settings-exam { 16 | & > .can-be-opened { 17 | cursor: pointer; 18 | } 19 | & > .exam-slot { 20 | padding: 10px; 21 | } 22 | } 23 | 24 | .settings-exam-editable-inputs { 25 | display: flex; 26 | flex-direction: column; 27 | align-items: stretch; 28 | align-content: stretch; 29 | justify-content: stretch; 30 | margin: 10px 0; 31 | padding: 10px; 32 | gap: 10px; 33 | } 34 | 35 | .settings-exam-editable-input { 36 | position: relative; 37 | display: flex; 38 | flex-direction: row; 39 | justify-content: space-between; 40 | align-items: center; 41 | align-content: space-between; 42 | border-radius: 10px; 43 | 44 | & input, & select { 45 | background-color: rgb(255, 255, 255); 46 | border: 0px solid rgba(0,0,0,0); 47 | padding: 5px; 48 | &:focus { 49 | outline: none 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/components/SettingsClass/SettingsClass.scss: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* SettingsClass.scss :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 10:42:29 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | .settings-class { 16 | & > .can-be-opened { 17 | cursor: pointer; 18 | } 19 | & > .class-slot { 20 | padding: 10px; 21 | } 22 | } 23 | 24 | .settings-class-editable-inputs { 25 | display: flex; 26 | flex-direction: column; 27 | align-items: stretch; 28 | align-content: stretch; 29 | justify-content: stretch; 30 | margin: 10px 0; 31 | padding: 10px; 32 | gap: 10px; 33 | } 34 | 35 | .settings-class-editable-input { 36 | position: relative; 37 | display: flex; 38 | flex-direction: row; 39 | justify-content: space-between; 40 | align-items: center; 41 | align-content: space-between; 42 | border-radius: 10px; 43 | 44 | & input, & select { 45 | background-color: rgb(255, 255, 255); 46 | border: 0px solid rgba(0,0,0,0); 47 | padding: 5px; 48 | &:focus { 49 | outline: none 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/components/ClassSlot/ClassSlot.scss: -------------------------------------------------------------------------------- 1 | .lagon { 2 | background-image: linear-gradient(90deg, #3be69f 0%, #00b4c5 100%); 3 | } 4 | .sulfur { 5 | background-image: linear-gradient(90deg, #cac531 0%, #f3f9a7 100%); 6 | } 7 | .starfall { 8 | background-image: linear-gradient(90deg, #c99343 0%, #5f6aa5 100%); 9 | } 10 | .orange-coral { 11 | background-image: linear-gradient(90deg, #ff9966 0%, #ff5e62 100%); 12 | } 13 | .barbapapa { 14 | background-image: linear-gradient(90deg, #e28dd7 0%, #e351ea 100%); 15 | } 16 | .cool-blues { 17 | background-image: linear-gradient(90deg, #2193b0 0%, #6dd5ed 100%); 18 | } 19 | .amethyst { 20 | background-image: linear-gradient(90deg, #9d50bb 0%, #6e48aa 100%); 21 | } 22 | .park-life { 23 | background-image: linear-gradient(90deg, #add100 0%, #7b920a 100%); 24 | } 25 | .cherryblossoms { 26 | background-image: linear-gradient(90deg, #fbd3e9 0%, #bb377d 100%); 27 | } 28 | .reef { 29 | background-image: linear-gradient(90deg, #00d2ff 0%, #3a7bd5 100%); 30 | } 31 | .candy { 32 | background-image: linear-gradient(90deg, #d3959b 0%, #dbbae6 100%); 33 | } 34 | .nelson { 35 | background-image: linear-gradient(90deg, #f2709c 0%, #ff9472 100%); 36 | } 37 | .almost { 38 | background-image: linear-gradient(90deg, #ddd6f3 0%, #faaca8 100%); 39 | } 40 | .miaka { 41 | background-image: linear-gradient(90deg, #fc354c 0%, #bf0a74 100%); 42 | } 43 | .calm-darya { 44 | background-image: linear-gradient(90deg, #5f2c82 0%, #9d31f1 100%); 45 | } 46 | .juicy-orange { 47 | background-image: linear-gradient(90deg, #ff8008 0%, #ffc837 100%); 48 | } 49 | 50 | .class-slot { 51 | background-color: #ff9a8b; 52 | box-shadow: inset 0 0 20px rgba(177, 177, 177, 0.2); 53 | border-radius: 5px; 54 | position: relative; 55 | z-index: 15; 56 | display: flex; 57 | flex-direction: column; 58 | overflow: hidden; 59 | box-sizing: border-box; 60 | justify-items: stretch; 61 | &.selected { 62 | position: absolute; 63 | top: 0; 64 | left: 0; 65 | right: 0; 66 | min-height: 100%; 67 | min-width: max-content; 68 | box-shadow: 0 0 15px rgba(190, 190, 190, 0.5); 69 | z-index: 25; 70 | } 71 | } 72 | .class-slot-uvname { 73 | background-color: rgba(0, 0, 0, 0.5); 74 | color: white; 75 | padding: 5px; 76 | border-radius: 3px 3px 0 0; 77 | text-wrap: nowrap; 78 | display: inline-block; 79 | text-align: left; 80 | } 81 | .class-slot-place { 82 | text-align: left; 83 | color: black; 84 | padding: 5px 10px; 85 | } 86 | .class-slot-time { 87 | color: #444; 88 | padding: 5px 10px; 89 | } 90 | -------------------------------------------------------------------------------- /src/utils/parseCache.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* parseCache.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 18:05:47 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { Class, Exam } from 'utils' 16 | 17 | const parseCache = (cache: string | null, object_type: 'Classes' | 'Exams' | null): any => { 18 | if (cache === null) 19 | return null 20 | 21 | const json_object = JSON.parse(cache) 22 | const without_underscore = json_object.map((o: any) => { 23 | const new_object: any = {} 24 | for (const key in o) { 25 | new_object[key.replace('_', '')] = o[key] 26 | } 27 | return new_object 28 | }) 29 | switch (object_type) { 30 | case 'Classes': 31 | return without_underscore.map((c: any) => new Class(c)) 32 | case 'Exams': 33 | return without_underscore.map((e: any) => 34 | new Exam({ 35 | start: new Date(e.start), 36 | end: new Date(e.end), 37 | UVname: e.UVname, 38 | place: e.place, 39 | seat: e.seat, 40 | type: e.type 41 | }) 42 | ) 43 | default: 44 | return null 45 | } 46 | } 47 | 48 | export default parseCache -------------------------------------------------------------------------------- /src/data/getP24organization.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* getP24organization.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2024/02/22 17:32:23 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { parseSemester } from "utils" 16 | 17 | const organisation = ` 18 | ref: p24 19 | starts:2024/02/19 20 | ends:2024/07/12 21 | 2024/02/19-2024/02/25-A-x-x 22 | 2024/02/26-2024/02/29-A-x-x 23 | 24 | 2024/03/01-2024/03/03-A-x-x 25 | 2024/03/04-2024/03/10-A-H-x 26 | 2024/03/11-2024/03/17-B-x-x 27 | 2024/03/18-2024/03/24-A-x-x 28 | 2024/03/25-2024/03/31-B-x-x 29 | 30 | 2024/04/01-2024/04/01-B-C-x 31 | 2024/04/02-2024/04/08-A-x-x 32 | 2024/04/09-2024/04/15-B-x-x 33 | 2024/04/16-2024/04/22-A-M-x 34 | 2024/04/23-2024/04/28-B-x-x 35 | 2024/04/29-2024/04/30-A-H-x 36 | 37 | 2024/05/01-2024/05/05-A-H-x 38 | 2024/05/06-2024/05/06-B-x-x 39 | 2024/05/07-2024/05/07-A-x-Jeudi 40 | 2024/05/08-2024/05/09-A-C-x 41 | 2024/05/10-2024/05/15-A-x-x 42 | 2024/05/16-2024/05/19-B-x-x 43 | 2024/05/20-2024/05/20-B-C-x 44 | 2024/05/21-2024/05/22-B-x-x 45 | 2024/05/23-2024/05/23-B-x-Lundi 46 | 2024/05/24-2024/05/30-A-x-x 47 | 2024/05/31-2024/05/31-B-x-x 48 | 49 | 2024/06/01-2024/06/06-B-x-x 50 | 2024/06/07-2024/06/13-A-x-x 51 | 2024/06/14-2024/06/20-B-x-x 52 | 2024/06/21-2024/06/30-A-F-x 53 | ` 54 | 55 | const P24organization = parseSemester(organisation, 'P24') 56 | 57 | export default P24organization -------------------------------------------------------------------------------- /src/data/getA23organization.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* getA23organization.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2023/09/03 17:32:23 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { parseSemester } from "utils" 16 | 17 | const organisation = ` 18 | ref: a23 19 | starts:2023/09/01 20 | ends:2024/01/14 21 | 2023/09/11-2023/09/16-A-x-x 22 | 2023/09/17-2023/09/23-B-x-x 23 | 2023/09/24-2023/09/30-A-x-x 24 | 25 | 2023/10/01-2023/10/08-B-x-x 26 | 2023/10/09-2023/10/15-A-x-x 27 | 2023/10/16-2023/10/18-B-x-x 28 | 2023/10/19-2023/10/19-B-C-x 29 | 2023/10/20-2023/10/22-B-x-x 30 | 2023/10/23-2023/10/23-B-x-Jeudi 31 | 2023/10/24-2023/10/28-A-M-x 32 | 2023/10/29-2023/10/31-A-H-x 33 | 34 | 2023/11/01-2023/11/05-A-H-x 35 | 2023/11/06-2023/11/06-A-M-x 36 | 2023/11/07-2023/11/10-B-x-x 37 | 2023/11/11-2023/11/11-B-C-x 38 | 2023/11/12-2023/11/13-B-x-x 39 | 2023/11/14-2023/11/20-A-x-x 40 | 2023/11/21-2023/11/27-B-x-x 41 | 2023/11/28-2023/11/30-A-x-x 42 | 43 | 2023/12/01-2023/12/04-A-x-x 44 | 2023/12/05-2023/12/11-B-x-x 45 | 2023/12/12-2023/12/18-A-x-x 46 | 2023/12/19-2023/12/22-B-x-x 47 | 2023/12/23-2023/12/31-A-H-x 48 | 49 | 2024/01/01-2024/01/02-A-H-x 50 | 2024/01/03-2024/01/03-B-x-Lundi 51 | 2024/01/04-2024/01/04-B-x-Samedi 52 | 2024/01/05-2024/01/13-B-F-x 53 | ` 54 | 55 | const P23organization = parseSemester(organisation, 'A23') 56 | 57 | export default P23organization -------------------------------------------------------------------------------- /src/utils/parseExamsLine.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* parseExamsLine.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/19 12:18:02 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { Exam } from 'utils' 16 | 17 | const parseExamsLine = (line: string, type: 'médian' | 'final'): Exam | undefined => { 18 | const match = line.match( 19 | /([A-Z0-9]{4})[\s,:le]*\s*([0-9]{2})\/([0-9]{2})\/([0-9]{4})\s*de\s*([0-9]{2}:[0-9]{2})\s*à\s*([0-9]{2}:[0-9]{2})[\s,:]*([0-9()A-Za-z\s]*[0-9()A-Za-z])[\s,:]*(place\s*[0-9]*)/ 20 | ) 21 | if (match?.length) { 22 | const UVname = match[1] 23 | const day = Number(match[2]) 24 | const month = Number(match[3]) - 1 25 | const year = Number(match[4]) 26 | const startTime = match[5] 27 | const endTime = match[6] 28 | const place = match[7] 29 | const seat = match[8] 30 | 31 | const startDate = new Date(year, month, day) 32 | startDate.setHours(parseInt(startTime.split(':')[0])) 33 | startDate.setMinutes(parseInt(startTime.split(':')[1])) 34 | 35 | const endDate = new Date(year, month, day) 36 | endDate.setHours(parseInt(endTime.split(':')[0])) 37 | endDate.setMinutes(parseInt(endTime.split(':')[1])) 38 | 39 | const exam = new Exam({ 40 | UVname, 41 | start: startDate, 42 | end: endDate, 43 | place, 44 | seat, 45 | type 46 | }) 47 | return exam 48 | } 49 | return undefined 50 | } 51 | 52 | export default parseExamsLine 53 | -------------------------------------------------------------------------------- /src/utils/index.js: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* index.js :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 14:30:01 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import Class from './Class' 16 | import Exam from './Exam' 17 | import parseClassesMail from './parseClassesMail' 18 | import parseExamsMail from './parseExamsMail' 19 | import parseClassesLine from './parseClassesLine' 20 | import parseClassesDay from './parseClassesDay' 21 | import daysIndex from './daysIndex' 22 | import moveDate from './moveDate' 23 | import getMonday from './getMonday' 24 | import getDayLabel from './getDayLabel' 25 | import SemesterPlanning from './SemesterPlanning' 26 | import DaySemesterOrganization from './DaySemesterOrganization' 27 | import parseSemester from './parseSemester' 28 | import isKifyAccepted from './isKifyAccepted' 29 | import { classesToICS, examsToICS} from './toICS' 30 | import saveFile from './saveFile' 31 | import loadFromLocalStorage from './loadFromLocalStorage' 32 | import parseCache from './parseCache' 33 | import saveToCache from './saveToCache' 34 | import printDate from './printDate' 35 | export { 36 | Class, 37 | parseClassesLine, 38 | parseClassesMail, 39 | parseClassesDay, 40 | Exam, 41 | parseExamsMail, 42 | daysIndex, 43 | moveDate, 44 | getMonday, 45 | getDayLabel, 46 | SemesterPlanning, 47 | DaySemesterOrganization, 48 | parseSemester, 49 | isKifyAccepted, 50 | classesToICS, 51 | examsToICS, 52 | saveFile, 53 | loadFromLocalStorage, 54 | parseCache, 55 | saveToCache, 56 | printDate 57 | } 58 | -------------------------------------------------------------------------------- /src/components/SettingsSemester/SettingsSemester.scss: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* SettingsSemester.scss :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 22:46:35 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | .settings-semester { 16 | display: flex; 17 | flex-direction: column; 18 | row-gap: 10px; 19 | justify-content: stretch; 20 | align-items: flex-start; 21 | align-content: stretch; 22 | } 23 | .settings-semester_day { 24 | position: relative; 25 | } 26 | 27 | .settings-semester_day-label { 28 | background-color: rgb(107, 44, 254); 29 | color: white; 30 | border-radius: 5px; 31 | height: 20px; 32 | font-size: 14px; 33 | padding: 2px 5px; 34 | margin: 10px; 35 | 36 | &.finaux { 37 | background-color: rgb(156, 1, 135); 38 | } 39 | &.medians { 40 | background-color: rgb(156, 1, 135); 41 | } 42 | &.ferie { 43 | background-color: rgb(46, 67, 198); 44 | } 45 | &.becomesA{ 46 | background-color: rgb(9, 214, 173); 47 | } 48 | &.vacances{ 49 | background-color: rgb(124, 135, 197) 50 | } 51 | } 52 | 53 | .settings-week-alternance { 54 | display: flex; 55 | flex-direction: row; 56 | column-gap: 10px; 57 | justify-content: stretch; 58 | align-items: stretch; 59 | align-content: stretch; 60 | margin: 10px 0; 61 | } 62 | 63 | .settings-week-alternance-a { 64 | border-left: 10px solid rgb(231, 46, 5); 65 | padding: 0 5px; 66 | } 67 | .settings-week-alternance-b { 68 | border-left: 10px solid rgb(0, 11, 218); 69 | padding: 0 5px; 70 | } -------------------------------------------------------------------------------- /src/data/getA22organization.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* getA22organization.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/11 00:41:08 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { parseSemester } from "utils" 16 | 17 | const organisation = ` 18 | ref: a22 19 | starts:2022/09/01 20 | ends:2023/01/21 21 | 2022/08/01-2022/08/28-A-H-x 22 | 23 | 2022/09/12-2022/09/18-A-x-x 24 | 2022/09/19-2022/09/23-B-x-x 25 | 2022/09/24-2022/09/30-A-x-x 26 | 27 | 2022/10/01-2022/10/01-A-x-x 28 | 2022/10/02-2022/10/09-B-x-x 29 | 2022/10/10-2022/10/16-A-x-x 30 | 2022/10/17-2022/10/19-B-x-x 31 | 2022/10/20-2022/10/20-B-C-x 32 | 2022/10/21-2022/10/23-B-x-x 33 | 2022/10/24-2022/10/24-B-x-Jeudi 34 | 2022/10/25-2022/10/29-A-M-x 35 | 2022/10/30-2022/10/31-A-H-x 36 | 37 | 2022/11/01-2022/11/05-A-H-x 38 | 2022/11/06-2022/11/07-A-x-x 39 | 2022/11/08-2022/11/10-B-x-x 40 | 2022/11/11-2022/11/11-B-C-x 41 | 2022/11/12-2022/11/14-B-x-x 42 | 2022/11/15-2022/11/15-B-x-Vendredi 43 | 2022/11/16-2022/11/22-A-x-x 44 | 2022/11/23-2022/11/29-B-x-x 45 | 2022/11/30-2022/11/30-A-x-x 46 | 47 | 2022/12/01-2022/12/06-A-x-x 48 | 2022/12/07-2022/12/13-B-x-x 49 | 2022/12/14-2022/12/18-A-x-x 50 | 2022/12/19-2022/12/31-A-H-x 51 | 52 | 2023/01/01-2023/01/02-A-H-x 53 | 2023/01/03-2023/01/03-A-x-x 54 | 2023/01/04-2023/01/04-A-x-Lundi 55 | 2023/01/05-2023/01/11-B-x-x 56 | 2023/01/12-2023/01/14-B-F-x 57 | 2023/01/16-2023/01/20-B-F-x 58 | ` 59 | 60 | const A22organization = parseSemester(organisation, 'A22') 61 | 62 | export default A22organization -------------------------------------------------------------------------------- /src/data/getP23organization.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* getP23organization.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/26 16:18:52 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { parseSemester } from "utils" 16 | 17 | const organisation = ` 18 | ref: p23 19 | starts:2023/01/24 20 | ends:2023/07/01 21 | 2023/02/11-2023/02/19-A-H-x 22 | 23 | 2023/03/06-2023/03/11-A-x-x 24 | 2023/03/13-2023/03/19-B-x-x 25 | 2023/03/20-2023/03/26-A-x-x 26 | 2023/03/27-2023/03/31-B-x-x 27 | 28 | 2023/04/01-2023/04/02-B-x-x 29 | 2023/04/03-2023/04/09-A-x-x 30 | 2023/04/10-2023/04/10-A-C-x 31 | 2023/04/11-2023/04/17-B-x-x 32 | 2023/04/18-2023/04/22-A-M-x 33 | 2023/04/24-2023/04/30-A-H-x 34 | 35 | 2023/05/01-2023/05/01-A-H-x 36 | 2023/05/02-2023/05/02-A-x-Lundi 37 | 2023/05/03-2023/05/07-B-x-x 38 | 2023/05/08-2023/05/08-B-C-x 39 | 2023/05/09-2023/05/09-B-x-x 40 | 2023/05/10-2023/05/10-B-x-Lundi 41 | 2023/05/11-2023/05/17-A-x-x 42 | 2023/05/18-2023/05/18-A-C-x 43 | 2023/05/19-2023/05/25-B-x-x 44 | 2023/05/26-2023/05/26-A-x-Lundi 45 | 2023/05/27-2023/05/28-A-x-x 46 | 2023/05/29-2023/05/29-A-C-x 47 | 2023/05/30-2023/05/31-A-x-x 48 | 49 | 2023/06/01-2023/06/02-A-x-x 50 | 2023/06/03-2023/06/09-B-x-x 51 | 2023/06/10-2023/06/16-A-x-x 52 | 2023/06/17-2023/06/23-B-x-x 53 | 2023/06/24-2023/06/24-A-F-x 54 | 2023/06/26-2023/06/30-A-F-x 55 | 56 | 2023/07/01-2023/07/01-A-F-x 57 | 58 | 2023/07/15-2023/07/31-A-H-x 59 | ` 60 | 61 | const P23organization = parseSemester(organisation, 'P23') 62 | 63 | export default P23organization -------------------------------------------------------------------------------- /src/data/getA25organization.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* getP24organization.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2025/09/06 17:32:23 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { parseSemester } from 'utils' 16 | 17 | const organisation = ` 18 | ref: a25 19 | starts:2025/08/26 20 | ends:2026/01/31 21 | 22 | 2025/09/01-2025/09/06-x-x-x 23 | 2025/09/08-2025/09/13-A-x-x 24 | 2025/09/15-2025/09/20-B-x-x 25 | 2025/09/22-2025/09/27-A-x-x 26 | 2025/09/29-2025/09/30-B-x-x 27 | 28 | 2025/10/01-2025/10/04-B-x-x 29 | 2025/10/06-2025/10/11-A-x-x 30 | 2025/10/13-2025/10/15-B-x-x 31 | 2025/10/16-2025/10/16-B-C-x # Comutec 32 | 2025/10/17-2025/10/18-B-x-x 33 | 2025/10/20-2025/10/20-B-x-Jeudi 34 | 2025/10/21-2025/10/25-A-M-x # Examens médians 35 | 2025/10/26-2025/10/31-A-H-x # Vacances de la Toussaint 36 | 37 | 2025/11/01-2025/11/02-A-H-x # Vacances de la Toussaint 38 | 2025/11/03-2025/11/03-A-M-x 39 | 2025/11/04-2025/11/10-B-x-x 40 | 2025/11/11-2025/11/11-A-C-x # 11 Novembre férié 41 | 2025/11/12-2025/11/18-A-x-x 42 | 2025/11/19-2025/11/25-B-x-x 43 | 2025/11/26-2025/11/29-A-x-x 44 | 45 | 2025/12/01-2025/12/02-A-x-x 46 | 2025/12/03-2025/12/09-B-x-x 47 | 2025/12/10-2025/12/16-A-x-x 48 | 2025/12/17-2025/12/19-B-x-x 49 | 2025/12/20-2025/12/31-A-H-x # Vacances de Noël 50 | 51 | 2026/01/01-2026/01/04-A-H-x # Suite des vacances de Noël 52 | 2026/01/05-2026/01/06-B-x-x # Fin des cours 53 | 2026/01/07-2026/01/07-B-x-Samedi 54 | 2026/01/08-2026/01/16-A-F-x # Examens finaux 55 | ` 56 | 57 | const A25organization = parseSemester(organisation, 'A25') 58 | 59 | export default A25organization 60 | -------------------------------------------------------------------------------- /src/components/ExamSlot/ExamSlot.tsx: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* ExamSlot.tsx :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 18:05:47 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { Exam } from 'utils' 16 | import { CgPin } from 'react-icons/cg' 17 | import { BsClock } from 'react-icons/bs' 18 | 19 | import './ExamSlot.scss' 20 | 21 | export interface ExamSlotProps { 22 | unit: Exam 23 | selected: boolean 24 | setSelected: () => void 25 | colStartIndex: number 26 | colEndIndex: number 27 | rowStartIndex: number 28 | rowEndIndex: number 29 | } 30 | 31 | const ExamSlot = (props: ExamSlotProps) => { 32 | const { 33 | unit, 34 | colStartIndex, 35 | colEndIndex, 36 | rowStartIndex, 37 | rowEndIndex, 38 | selected, 39 | setSelected, 40 | } = props 41 | 42 | return ( 43 |
setSelected()} 48 | > 49 | 50 | {unit.UVname} - {unit.type} 51 | 52 | 53 | 54 | {`${unit.place}`} {unit.seat? `, ${unit.seat}`:''} 55 | 56 | {selected && ( 57 | 58 | 59 | {` de ${unit.printTime(unit.start)} à ${unit.printTime(unit.end)}`} 60 | 61 | )} 62 |
63 | ) 64 | } 65 | 66 | export default ExamSlot 67 | -------------------------------------------------------------------------------- /src/components/ClassSlot/ClassSlot.tsx: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* ClassSlot.tsx :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/12 16:01:28 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { Class } from 'utils' 16 | import { CgPin } from 'react-icons/cg' 17 | import { RiBook2Line } from 'react-icons/ri' 18 | import { BsClock } from 'react-icons/bs' 19 | 20 | import './ClassSlot.scss' 21 | 22 | export interface ClassSlotProps { 23 | unit: Class 24 | selected: boolean 25 | setSelected: () => void 26 | colStartIndex: number 27 | colEndIndex: number 28 | rowStartIndex: number 29 | rowEndIndex: number 30 | } 31 | 32 | const ClassSlot = (props: ClassSlotProps) => { 33 | const { 34 | unit, 35 | colStartIndex, 36 | colEndIndex, 37 | rowStartIndex, 38 | rowEndIndex, 39 | selected, 40 | setSelected, 41 | } = props 42 | 43 | return ( 44 |
setSelected()} 49 | > 50 | 51 | {unit.UVname} - {unit.prettyClassType} {unit.classReference} 52 | 53 | 54 | 55 | {unit.place} 56 | 57 | {selected && ( 58 | 59 | 60 | {` de ${unit.start} à ${unit.end}`} 61 | 62 | )} 63 |
64 | ) 65 | } 66 | 67 | export default ClassSlot 68 | -------------------------------------------------------------------------------- /src/data/getA24organization.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* getP24organization.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2024/09/06 17:32:23 by wklover14 :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { parseSemester } from 'utils' 16 | 17 | const organisation = ` 18 | ref: a24 19 | starts:2024/09/02 20 | ends:2025/01/18 21 | 22 | 2024/09/02-2024/09/07-x-x-x 23 | 2024/09/09-2024/09/14-A-x-x 24 | 2024/09/16-2024/09/21-B-x-x 25 | 2024/09/23-2024/09/28-A-x-x 26 | 2024/09/30-2024/09/30-B-x-x 27 | 28 | 2024/10/31-2024/10/05-B-x-x 29 | 2024/10/07-2024/10/12-A-x-x 30 | 2024/10/14-2024/10/16-B-x-x 31 | 2024/10/17-2024/10/17-B-C-x 32 | 2024/10/18-2024/10/19-B-x-x 33 | 2024/10/21-2024/10/21-B-x-Jeudi 34 | 2024/10/22-2024/10/26-A-M-x # Examens médians 35 | 2024/10/28-2024/10/31-A-H-x # Vacances de la Toussaint 36 | 37 | 2024/11/01-2024/11/02-A-H-x # Vacances de la Toussaint 38 | 2024/11/04-2024/11/04-A-M-x 39 | 2024/11/05-2024/11/09-B-x-x 40 | 2024/11/11-2024/11/11-A-C-x # Lundi 11 Novembre férié 41 | 2024/11/12-2024/11/12-B-x-Lundi 42 | 2024/11/13-2024/11/16-A-x-x 43 | 2024/11/18-2024/11/19-A-x-x 44 | 2024/11/20-2024/11/23-B-x-x 45 | 2024/11/25-2024/11/26-B-x-x 46 | 2024/11/27-2024/11/30-A-x-x 47 | 48 | 2024/12/02-2024/12/03-A-x-x 49 | 2024/12/04-2024/12/07-B-x-x 50 | 2024/12/09-2024/12/10-B-x-x 51 | 2024/12/11-2024/12/14-A-x-x 52 | 2024/12/16-2024/12/17-A-x-x 53 | 2024/12/18-2024/12/20-B-x-x 54 | 2024/12/21-2024/12/31-A-H-x # Vacances de Noël 55 | 56 | 2025/01/01-2025/01/04-A-H-x # Suite des vacances de Noël 57 | 2025/01/06-2025/01/07-B-x-x # Fin des cours 58 | 2025/01/08-2025/01/08-B-x-Samedi 59 | 2025/01/09-2025/01/18-A-F-x # Examens finaux 60 | ` 61 | 62 | const A24organisation = parseSemester(organisation, 'A24') 63 | 64 | export default A24organisation 65 | -------------------------------------------------------------------------------- /src/utils/DaySemesterOrganization.ts: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* DaySemesterOrganization.ts :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/11 00:35:36 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { weekAlternance } from "types/weekAlternance" 16 | 17 | 18 | export default class DaySemesterOrganization { 19 | private _date: Date 20 | private _weekAlternance: weekAlternance 21 | private _becomesA: string | undefined 22 | private _isHoliday: boolean | undefined 23 | private _isMedian: boolean | undefined 24 | private _isFinal: boolean | undefined 25 | private _isFerie: boolean | undefined 26 | 27 | constructor( 28 | date: Date, 29 | options?: { 30 | weekAlternance?: weekAlternance 31 | becomesA?: 32 | | 'Lundi' 33 | | 'Mardi' 34 | | 'Mercredi' 35 | | 'Jeudi' 36 | | 'Vendredi' 37 | | 'Samedi' 38 | isHoliday?: boolean 39 | isMedian?: boolean 40 | isFinal?: boolean 41 | isFerie?: boolean 42 | } 43 | ) { 44 | this._date = date 45 | this._weekAlternance = options?.weekAlternance 46 | this._becomesA = options?.becomesA 47 | this._isHoliday = options?.isHoliday 48 | this._isMedian = options?.isMedian 49 | this._isFinal = options?.isFinal 50 | this._isFerie = options?.isFerie 51 | } 52 | 53 | get date() { 54 | return this._date 55 | } 56 | get weekAlternance() { 57 | return this._weekAlternance 58 | } 59 | get becomesA() { 60 | return this._becomesA 61 | } 62 | get isHoliday() { 63 | return this._isHoliday 64 | } 65 | get isMedian() { 66 | return this._isMedian 67 | } 68 | 69 | get isFinal() { 70 | return this._isFinal 71 | } 72 | 73 | get isFerie() { 74 | return this._isFerie 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /src/components/PasteMail/PasteMail.tsx: -------------------------------------------------------------------------------- 1 | /* *********************************************************************************************************************** */ 2 | /* UTC Header */ 3 | /* :::::::::::::::::::: ::: ::: ::::::::::: :::::::: */ 4 | /* PasteMail.tsx :::::::::::::::::::: :+: :+: :+: :+: :+: */ 5 | /* ::::::::::::::+++#####+++ +:+ +:+ +:+ +:+ */ 6 | /* By: branlyst ::+++##############+++ +:+ +:+ +:+ +:+ */ 7 | /* https://github.com/StephaneBranly +++##############+++:::: +#+ +:+ +#+ +#+ */ 8 | /* +++##+++:::::::::::::: +#+ +:+ +#+ +#+ */ 9 | /* :::::::::::::::::::: +#+ +#+ +#+ +#+ */ 10 | /* :::::::::::::::::::: #+# #+# #+# #+# #+# */ 11 | /* Update: 2022/12/13 10:45:39 by branlyst :::::::::::::::::::: ######## ### ######## .fr */ 12 | /* */ 13 | /* *********************************************************************************************************************** */ 14 | 15 | import { createRef } from 'react' 16 | import { Class, parseClassesMail } from 'utils' 17 | import './PasteMail.scss' 18 | 19 | export interface PasteMailProps { 20 | setClasses: (classes: Class[]) => void 21 | } 22 | 23 | const PasteMail = (props: PasteMailProps) => { 24 | const { setClasses } = props 25 | 26 | const ref = createRef() 27 | 28 | const handlerLoadData = () => { 29 | if (!ref.current) return 30 | const data = parseClassesMail(ref.current.value) 31 | setClasses(data) 32 | } 33 | 34 | const placeHolder = `CM13 C 1 JEUDI... 10:15-12:15,F1,S=FA106 35 | CM13 D 2 MARDI... 16:30-18:30,F1,S=FA420 36 | CM13 T 1 A JEUDI... 14:30-18:30,F2,S=ES109 37 | 38 | LA13 D14 MERCREDI 10:15-12:15,F1,S=FC207 39 | 40 | LO01 C 1 LUNDI... 08:00-10:00,F1,S=FA104 41 | LO01 D 2 MERCREDI 14:15-16:15,F1,S=FA309 42 | LO01 T 4 A MERCREDI 16:30-18:30,F2,S=FB116 43 | 44 | NF02 C 1 MARDI... 08:30-10:00,F1,S=FA108 45 | NF02 D 1 MARDI... 10:15-12:15,F1,S=FA417 46 | NF02 T 3 B MARDI... 14:15-16:15,F2,S=J210C 47 | 48 | SC21 C 1 LUNDI... 14:15-16:15,F1,S=FA108 49 | SC21 D 3 LUNDI... 18:30-19:30,F1,S=FA306 50 | 51 | SY01 C 1 VENDREDI 10:15-12:15,F1,S=FA205 52 | SY01 D 4 JEUDI... 08:00-10:00,F1,S=FA616 53 | 54 | TC00 D 1 MARDI... 18:45-20:45,F1,S=FA100 55 | ` 56 | 57 | return ( 58 |
59 |