Closed thisismydesign closed 4 years ago
In GitLab by @gomorizsolt on Mar 20, 2019, 09:12
changed the description
In GitLab by @thisismydesign on Mar 20, 2019, 11:01
Responsiveness
Let's not worry about it for now.
dates
Is this necessary for the merge function? The month values should be correct so I guess it is? In that case, there should be a function which can take this and make it into an "up-to-date" empty calendar.
In GitLab by @thisismydesign on Mar 20, 2019, 11:04
Size / visibility.
Necessary requirements:
Nice to have requirements:
Feel free to extract this into an issue if needed, sicne they're not all that related to this PR.
In GitLab by @gomorizsolt on Mar 20, 2019, 11:12
Yes, the month values should be correct in any case. I'll try to accomplish a function that handles the "up-to-date" functionality.
Regarding the appearance, as you proposed, I'll create a separated issue to make it clear.
In GitLab by @gomorizsolt on Mar 20, 2019, 11:18
changed title from Basic{- calendar - JSON-} to Basic{+/empty calendar+}
In GitLab by @gomorizsolt on Mar 20, 2019, 11:29
changed the description
In GitLab by @gomorizsolt on Mar 20, 2019, 12:55
marked as a Work In Progress
In GitLab by @gomorizsolt on Mar 20, 2019, 14:05
added 1 commit
In GitLab by @gomorizsolt on Mar 20, 2019, 14:05
Implemented the feature of updating the contribution dates to the corresponding ones. I'd appreciate if you also tried the functionality out locally.
I'll create the missing tests later.
In GitLab by @gomorizsolt on Mar 21, 2019, 08:49
added 1 commit
In GitLab by @gomorizsolt on Mar 21, 2019, 09:09
added 2 commits
In GitLab by @gomorizsolt on Mar 21, 2019, 09:15
Missing tests have been completed and I also refined the function to update the basic calendar object properly. Otherwise, here are some questions:
CalendarUtils
folder? We may create other utility functions later that are related to the (basic) calendar.In GitLab by @gomorizsolt on Mar 21, 2019, 09:19
unmarked as a Work In Progress
In GitLab by @gomorizsolt on Mar 21, 2019, 09:21
added 1 commit
In GitLab by @gomorizsolt on Mar 21, 2019, 09:51
added 1 commit
In GitLab by @thisismydesign on Mar 21, 2019, 10:13
Why is string formatting needed there?
new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toLocaleDateString() == new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toLocaleDateString().replace(/. /g, '-').slice(0, 10);
> true
In any case, date formatting should not be done with string formatting. I'm sure there are libraries for that and toLocaleDateString
also takes format params: https://stackoverflow.com/a/34015511/2771889
In GitLab by @thisismydesign on Mar 21, 2019, 10:13
Same date formatting issue here
In GitLab by @thisismydesign on Mar 21, 2019, 10:14
Same date formatting issue here
In GitLab by @thisismydesign on Mar 21, 2019, 10:16
I'd also make sure that the last date is correct. Those two should make us fairly certain that it works.
In GitLab by @thisismydesign on Mar 21, 2019, 10:17
GetTodaysCalendar
maybe?
In GitLab by @thisismydesign on Mar 21, 2019, 10:18
Left a few comments, also agree with CalendarUtils
, you can just call the file that too.
In GitLab by @gomorizsolt on Mar 21, 2019, 10:18
Sounds much better, thanks.
In GitLab by @gomorizsolt on Mar 21, 2019, 10:26
That's a good idea, thanks.
In GitLab by @gomorizsolt on Mar 21, 2019, 10:27
Does it mean that it's not a good practice to rely on string transformer functions in the case of dates? For example replace
, slice
and so forth.
Btw you're absolutely right, this should be handled somehow in JS.
In GitLab by @thisismydesign on Mar 21, 2019, 10:31
Yep. There're usually very extensive libraries to do this for you. I can show an example from ruby: https://apidock.com/ruby/DateTime/strftime
In GitLab by @thisismydesign on Mar 21, 2019, 10:32
But here it also seems to me that no formatting is required, hence the code example.
In GitLab by @gomorizsolt on Mar 21, 2019, 10:41
I don't really get it. Why don't we need to format the date?
In GitLab by @thisismydesign on Mar 21, 2019, 10:42
Because
new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toLocaleDateString() == new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toLocaleDateString().replace(/. /g, '-').slice(0, 10);
> true
In GitLab by @gomorizsolt on Mar 22, 2019, 00:33
changed this line in version 7 of the diff
In GitLab by @gomorizsolt on Mar 22, 2019, 00:33
changed this line in version 7 of the diff
In GitLab by @gomorizsolt on Mar 22, 2019, 00:33
changed this line in version 7 of the diff
In GitLab by @gomorizsolt on Mar 22, 2019, 00:33
changed this line in version 7 of the diff
In GitLab by @gomorizsolt on Mar 22, 2019, 00:33
changed this line in version 7 of the diff
In GitLab by @gomorizsolt on Mar 22, 2019, 00:33
added 2 commits
In GitLab by @gomorizsolt on Mar 22, 2019, 00:55
added 1 commit
In GitLab by @gomorizsolt on Mar 22, 2019, 00:59
added 1 commit
In GitLab by @bencefrelli on Mar 22, 2019, 09:19
The code looks good to me, just one remark. Are you know the moment.js library? This is a lot of easier date handler. You can format dates and subtract, add days, years etc. Eg:
moment().subtract(1, 'years').format(YYYY-MM-DD)
In GitLab by @gomorizsolt on Mar 22, 2019, 09:32
Yes, I have already heard of that library, but didn't know that it can even handle basic operations on dates. The example you mentioned above is much more readable.
I'll take a look at this later.
In GitLab by @gomorizsolt on Mar 22, 2019, 13:53
added 1 commit
In GitLab by @gomorizsolt on Mar 22, 2019, 13:53
Cool, it works as expected. Thanks for the proposal @bencefrelli.
In GitLab by @bencefrelli on Mar 22, 2019, 19:10
approved this merge request
In GitLab by @gomorizsolt on Mar 22, 2019, 19:28
merged
In GitLab by @gomorizsolt on Mar 22, 2019, 19:28
mentioned in commit a18dc64f472151f441b70bb59b021ca2d38d1f82
In GitLab by @gomorizsolt on Mar 20, 2019, 09:09
_Merges issue-7basic-calendar -> master
Issue #9.
Created a static JSON calendar to prepare for the SVG displaying.
Questions:
data-date
property within each children is fixed. Should we update them based on the current date? The other case is that it doesn't really matter since we'll only display the colors in the beginning.Any ideas about the appearance of the SVG are welcome. Attached a screenshot below.