Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions dist/rome.standalone.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ function calendar (calendarOptions) {
var lastMonth;
var lastDay;
var lastDayElement;
var lastTimeElement;
var datewrapper;
var back;
var next;
Expand All @@ -381,6 +382,7 @@ function calendar (calendarOptions) {
lastYear = no;
lastDay = no;
lastDayElement = no;
lastTimeElement = no;
o.appendTo.appendChild(container);

removeChildren(container);
Expand Down Expand Up @@ -954,6 +956,15 @@ function calendar (calendarOptions) {
if (!classes.contains(target, o.styles.timeOption)) {
return;
}
if (!classes.contains(target, o.styles.selectedTime)) {
if (lastTimeElement) {
classes.remove(lastTimeElement, o.styles.selectedTime);
}
if(target){
classes.add(target, o.styles.selectedTime);
}
lastTimeElement = target;
}
var value = momentum.moment(text(target), o.timeFormat);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

dist files are autogenerated, please roll back these changes

setTime(ref, value);
refCal = ref.clone();
Expand Down
11 changes: 11 additions & 0 deletions src/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function calendar (calendarOptions) {
var lastMonth;
var lastDay;
var lastDayElement;
var lastTimeElement;
var datewrapper;
var back;
var next;
Expand All @@ -55,6 +56,7 @@ function calendar (calendarOptions) {
lastYear = no;
lastDay = no;
lastDayElement = no;
lastTimeElement = no;
o.appendTo.appendChild(container);

removeChildren(container);
Expand Down Expand Up @@ -628,6 +630,15 @@ function calendar (calendarOptions) {
if (!classes.contains(target, o.styles.timeOption)) {
return;
}
if (!classes.contains(target, o.styles.selectedTime)) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This check is unnecessary

if (lastTimeElement) {
classes.remove(lastTimeElement, o.styles.selectedTime);
}
if(target){
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Please match the existing coding style, e.g: if (target) {

classes.add(target, o.styles.selectedTime);
}
lastTimeElement = target;
}
var value = momentum.moment(text(target), o.timeFormat);
setTime(ref, value);
refCal = ref.clone();
Expand Down