Skip to content
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

feat: Week.options.hourStart, Week.options.hourEnd (resolves: #175) #189

Merged
merged 1 commit into from
Sep 5, 2018

Conversation

youjung-hong
Copy link
Contributor

Please check if the PR fulfills these requirements

  • It's submitted to right branch according to our branching model
  • It's right issue type on title
  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix #xxx[,#xxx], where "xxx" is the issue number)
  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • It does not introduce a breaking change or has description for the breaking change

Description

fixes: #175


Thank you for your contribution to TOAST UI product. 🎉 😘 ✨

@@ -42,7 +42,9 @@
}],
week: {
showTimezoneCollapseButton: true,
timezonesCollapsed: false
timezonesCollapsed: false,
hourStart: 8,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove using this options in example code.

* @returns {object} view model for time part.
*/
getViewModelForTimeView: function(start, end, time) {
getViewModelForTimeView: function(start, end, time, options) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make weekly options object separate with this module. This function doesn't need to know all options of weekly, just only to know hourStart, hourEnd.

{{#if model.isFocused}}
color: #ffffff; background-color:{{model.color}}; border-color:{{model.color}};
{{else}}
color:{{model.color}}; background-color:{{model.bgColor}}; border-color:{{model.borderColor}};
{{/if}}
{{model.customStyle}}"
>{{{time-tmpl model}}}</div>
{{#unless cropped}}<div class="{{CSS_PREFIX}}time-resize-handle handle-x" style="margin-left: {{@root.styles.paddingLeft}};">&nbsp;</div>{{/unless}}
{{#unless isReadOnly}}<div class="{{CSS_PREFIX}}time-resize-handle handle-x" style="margin-left: {{@root.styles.paddingLeft}};">&nbsp;</div>{{/unless}}
Copy link
Contributor

@dongsik-yoo dongsik-yoo Sep 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the end time is over 24:00, the resize handle should be hidden.

* @returns {object} bound object for supplied view model.
*/
Time.prototype.getScheduleViewBound = function(viewModel, options) {
var X = this._getScheduleViewBoundX(viewModel, options);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable name should be lower case. Our eslint rule must be needed update.

Time.prototype.getScheduleViewBound = function(viewModel, options) {
var X = this._getScheduleViewBoundX(viewModel, options);
var Y = this._getScheduleViewBoundY(viewModel, options);
var isReadOnly = util.pick(viewModel, 'model', 'isReadOnly') || options.isReadOnly || false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it necessary to check whether options.isReadOnly is undefined?

Copy link
Contributor

@dongsik-yoo dongsik-yoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I leave some comments.

@dongsik-yoo
Copy link
Contributor

All schedules should be shown in weekly if hourStart and hourEnd options are omitted. There is no schedule under no those option condition.

@dongsik-yoo dongsik-yoo merged commit e546cc7 into master Sep 5, 2018
@dongsik-yoo dongsik-yoo deleted the feat/week-period branch September 5, 2018 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to add a period of time?
2 participants