Parameterize datepicker start day and textinput format #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Preliminary observations
In order to run
lein figwheel basic
successfully, I had the need of installing jdk 8 because of some outdated dependencies of the project, as well as adding a dependency to[org.clojure/tools.nrepl "0.2.13"]
.I decided not to push project.clj just in case that there is a different way that the team solves that without affecting the app-level deps.
The port in the URL listed in the readme turned out to be incorrect as it turns out the port that's set in the config file is the
3450
. Modified the readme to reflect that.Objective
I was required to implement a couple of changes in the widgets:
These changes were made trying to not disrupt the current state of affairs and/or patterns already established in the codebase. I feel that more of a team discussion would be needed in order to propose changes and to truly understand the current design and the rationale behind the decisions.
Rationale
In the case of the datepicker task, it was a matter of how the previous and next months were being generated. In order to make it start from Sunday it was necessary to render the previous month from a day earlier than before (as it began on a Monday) and to render the next one with one fewer day in order to preserve the expected dimensions of the matrix.
It was decided to just use a boolean since that would cover the vast majority of cases, and it would still be relatively simple to map a more flexible alternative (like keywords) to different offsets and thus being able to render starting from any day
Regarding the textinput task, it was necessary to identify at what points of the code a default format was being chosen for masking and input/output time conversions, and then using the newly-added
date-format
property if it'd been passed into the component.It was decided to add a validation for the
date-format
field so as to ensure no unexpected behaviors happen, and all possible values for it were tested manually (although informally).