New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
library: Add Calendar Entry #239
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also put an example of calendar marks?
src/Library/demos/Calendar/main.blp
Outdated
|
||
Adw.StatusPage { | ||
title: "Calendar"; | ||
description: "Keep track of current or upcoming events"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that'd make sense as a description for an end user calendar app but not here
I'll let you come up with a new suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about : an arrangement of time into days, weeks, months, and years?
src/Library/demos/Calendar/main.js
Outdated
calendar.connect("next-month", () => { | ||
console.log("Switched to Next Month"); | ||
}); | ||
calendar.connect("next-year", () => { | ||
console.log("Switched to Next Year"); | ||
}); | ||
calendar.connect("prev-month", () => { | ||
console.log("Switched to Previous Month"); | ||
}); | ||
calendar.connect("prev-year", () => { | ||
console.log("Switched to Previous Year"); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't really think of use case for these signals
I'd remove them - @andyholmes wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can connect to property changes instead
calendar.connect('notify::month', () => {
console.log(calendar.month);
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it would be an integer , i don't think that would be relevant to log.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. What about we log the day/month/year in the user locale?
src/Library/demos/Calendar/main.js
Outdated
let year = calendar.year; | ||
let month = calendar.month; | ||
let day = calendar.day; | ||
let monthString = month.toString().padStart(2, "0"); | ||
let dayString = day.toString().padStart(2, "0"); | ||
|
||
console.log( | ||
`Selected Date (YYYY-MM-DD): ${year}-${monthString}-${dayString}`, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use getDate
instead - it's the perfect opportunity to showcase the DateTime API :)
https://docs.gtk.org/glib/method.DateTime.format.html
Please use this to display the date:
%x: the preferred date representation for the current locale without the time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure
Sure I'd do that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
I made some slight adjustments 40edf52
The mark UI was a bit too complicated and unclear because you had to select a day to mark the day but the day selection style would make the mark invisible for that day.
Added Calendar Demo under User Interface Section in Library
Issue workbenchdev/demos#3