For this task, you will be working on an app to track working hours called "Time to Leave". "Time to Leave" is a web-application written in JavaScript running in Electron, and allows to enter working and break times to show a notification, when the daily amount of work hours is reached.
Setup
Start the app in the terminal using the command npm run dev
To stop the app, use CTRL+C within the terminal
Feature Request
Users have requested to export their monthly overview of logged times and overall overtime as a PDF. The already included button in the user interface (indicated in red in the picture) should trigger the PDF export of the currently shown month, instead of exporting a screenshot of the app. Please read the following text carefully to implement this task.
While coding
π While working, search online for needed information. It is quicker than navigating through the entire codebase.
π Save the file to see the effects of your changes - no need to restart the app.
Task Description
To implement this feature, two changes are necessary:
Change 1: Implement PDF export functionality
ToDo: Modify the functionality of the "Create Report" button (see file renderer/classes/FlexibleMonthCalendar.js) and adapt the code to create a PDF export.
Note 1: Please use the printToPDF function of the electron framework to print the shown app to a PDF document. The current implementation uses the capturePage function of the electron framework to create the screenshot.
Note 2: Please hard-code the location to be used for storing the PDF
Note 3: You can open the "Developer Tools" via the application menu "View" -> "Toggle developer tools".
Test: You are done when the exported PDF time-to-leave-report.pdf on your Desktop looks like the following screenshot:
Change 2: Change the button icon
ToDo: To make the function of the button more clear, change the icon of the "Create Report" button in renderer/classes/FlexibleMonthCalendar.js.
Note 1: You can use the file print.svg as new icon for the button
Note 2: You can open the "Developer Tools" via the application menu "View" -> "Toggle developer tools".
Test: You are done when clicking the "Create report" button stores the PDF on the desktop, and when the button looks as shown in the following screenshot:
Project
For this task, you will be working on an app to track working hours called "Time to Leave". "Time to Leave" is a web-application written in JavaScript running in Electron, and allows to enter working and break times to show a notification, when the daily amount of work hours is reached.
Setup
npm run dev
CTRL+C
within the terminalFeature Request
Users have requested to export their monthly overview of logged times and overall overtime as a PDF. The already included button in the user interface (indicated in red in the picture) should trigger the PDF export of the currently shown month, instead of exporting a screenshot of the app. Please read the following text carefully to implement this task.
While coding
π While working, search online for needed information. It is quicker than navigating through the entire codebase. π Save the file to see the effects of your changes - no need to restart the app.
Task Description
To implement this feature, two changes are necessary:
Change 1: Implement PDF export functionality
renderer/classes/FlexibleMonthCalendar.js
) and adapt the code to create a PDF export.printToPDF
function of theelectron framework
to print the shown app to a PDF document. The current implementation uses thecapturePage
function of theelectron framework
to create the screenshot.time-to-leave-report.pdf
on your Desktop looks like the following screenshot:Change 2: Change the button icon
renderer/classes/FlexibleMonthCalendar.js
.print.svg
as new icon for the button