diff --git a/public/resources/themes/luna-amber/theme.css b/public/resources/themes/luna-amber/theme.css index e1279d2623..bc3c6fcab9 100644 --- a/public/resources/themes/luna-amber/theme.css +++ b/public/resources/themes/luna-amber/theme.css @@ -940,6 +940,9 @@ body .p-datepicker table { body .p-datepicker table th { padding: 0.5em; } +body .p-datepicker table th.p-datepicker-weekheader { + border-right: 1px solid #191919; +} body .p-datepicker table td { padding: 0.5em; } @@ -965,6 +968,9 @@ body .p-datepicker table td.p-datepicker-today > span.p-highlight { color: #212121; background-color: #FFB300; } +body .p-datepicker table td.p-datepicker-weeknumber { + border-right: 1px solid #191919; +} body .p-datepicker .p-datepicker-buttonbar { border-top: 1px solid #3f3f3f; } @@ -2584,6 +2590,17 @@ body .p-tree.p-tree-horizontal .p-treenode .p-treenode-content.p-treenode-select background-color: #4c4c4c; color: #dedede; } +body .p-tree .p-tree-filter-container .p-tree-filter { + width: 100%; + padding-right: 2em; +} +body .p-tree .p-tree-filter-container .p-tree-filter-icon { + top: 50%; + left: auto; + margin-top: -0.5em; + right: 0.8em; + color: #252525; +} body .p-organizationchart .p-organizationchart-node-content.p-organizationchart-selectable-node:not(.p-highlight):hover { background-color: #4c4c4c; color: #dedede; diff --git a/public/resources/themes/luna-blue/theme.css b/public/resources/themes/luna-blue/theme.css index e1c0ad71a9..2fc25c8fdc 100644 --- a/public/resources/themes/luna-blue/theme.css +++ b/public/resources/themes/luna-blue/theme.css @@ -940,6 +940,9 @@ body .p-datepicker table { body .p-datepicker table th { padding: 0.5em; } +body .p-datepicker table th.p-datepicker-weekheader { + border-right: 1px solid #191919; +} body .p-datepicker table td { padding: 0.5em; } @@ -965,6 +968,9 @@ body .p-datepicker table td.p-datepicker-today > span.p-highlight { color: #ffffff; background-color: #1f7ed0; } +body .p-datepicker table td.p-datepicker-weeknumber { + border-right: 1px solid #191919; +} body .p-datepicker .p-datepicker-buttonbar { border-top: 1px solid #3f3f3f; } @@ -2584,6 +2590,17 @@ body .p-tree.p-tree-horizontal .p-treenode .p-treenode-content.p-treenode-select background-color: #4c4c4c; color: #dedede; } +body .p-tree .p-tree-filter-container .p-tree-filter { + width: 100%; + padding-right: 2em; +} +body .p-tree .p-tree-filter-container .p-tree-filter-icon { + top: 50%; + left: auto; + margin-top: -0.5em; + right: 0.8em; + color: #252525; +} body .p-organizationchart .p-organizationchart-node-content.p-organizationchart-selectable-node:not(.p-highlight):hover { background-color: #4c4c4c; color: #dedede; diff --git a/public/resources/themes/luna-green/theme.css b/public/resources/themes/luna-green/theme.css index 53287df2d3..d8e84a5d22 100644 --- a/public/resources/themes/luna-green/theme.css +++ b/public/resources/themes/luna-green/theme.css @@ -940,6 +940,9 @@ body .p-datepicker table { body .p-datepicker table th { padding: 0.5em; } +body .p-datepicker table th.p-datepicker-weekheader { + border-right: 1px solid #191919; +} body .p-datepicker table td { padding: 0.5em; } @@ -965,6 +968,9 @@ body .p-datepicker table td.p-datepicker-today > span.p-highlight { color: #ffffff; background-color: #1ea04c; } +body .p-datepicker table td.p-datepicker-weeknumber { + border-right: 1px solid #191919; +} body .p-datepicker .p-datepicker-buttonbar { border-top: 1px solid #3f3f3f; } @@ -2584,6 +2590,17 @@ body .p-tree.p-tree-horizontal .p-treenode .p-treenode-content.p-treenode-select background-color: #4c4c4c; color: #dedede; } +body .p-tree .p-tree-filter-container .p-tree-filter { + width: 100%; + padding-right: 2em; +} +body .p-tree .p-tree-filter-container .p-tree-filter-icon { + top: 50%; + left: auto; + margin-top: -0.5em; + right: 0.8em; + color: #252525; +} body .p-organizationchart .p-organizationchart-node-content.p-organizationchart-selectable-node:not(.p-highlight):hover { background-color: #4c4c4c; color: #dedede; diff --git a/public/resources/themes/luna-pink/theme.css b/public/resources/themes/luna-pink/theme.css index ff5e69ed73..16d8c0ad67 100644 --- a/public/resources/themes/luna-pink/theme.css +++ b/public/resources/themes/luna-pink/theme.css @@ -940,6 +940,9 @@ body .p-datepicker table { body .p-datepicker table th { padding: 0.5em; } +body .p-datepicker table th.p-datepicker-weekheader { + border-right: 1px solid #191919; +} body .p-datepicker table td { padding: 0.5em; } @@ -965,6 +968,9 @@ body .p-datepicker table td.p-datepicker-today > span.p-highlight { color: #ffffff; background-color: #cc285c; } +body .p-datepicker table td.p-datepicker-weeknumber { + border-right: 1px solid #191919; +} body .p-datepicker .p-datepicker-buttonbar { border-top: 1px solid #3f3f3f; } @@ -2584,6 +2590,17 @@ body .p-tree.p-tree-horizontal .p-treenode .p-treenode-content.p-treenode-select background-color: #4c4c4c; color: #dedede; } +body .p-tree .p-tree-filter-container .p-tree-filter { + width: 100%; + padding-right: 2em; +} +body .p-tree .p-tree-filter-container .p-tree-filter-icon { + top: 50%; + left: auto; + margin-top: -0.5em; + right: 0.8em; + color: #252525; +} body .p-organizationchart .p-organizationchart-node-content.p-organizationchart-selectable-node:not(.p-highlight):hover { background-color: #4c4c4c; color: #dedede; diff --git a/public/resources/themes/nova-colored/theme.css b/public/resources/themes/nova-colored/theme.css index 38427da511..daca429025 100644 --- a/public/resources/themes/nova-colored/theme.css +++ b/public/resources/themes/nova-colored/theme.css @@ -940,6 +940,9 @@ body .p-datepicker table { body .p-datepicker table th { padding: 0.5em; } +body .p-datepicker table th.p-datepicker-weekheader { + border-right: 1px solid #a6a6a6; +} body .p-datepicker table td { padding: 0.5em; } @@ -965,6 +968,9 @@ body .p-datepicker table td.p-datepicker-today > span.p-highlight { color: #ffffff; background-color: #007ad9; } +body .p-datepicker table td.p-datepicker-weeknumber { + border-right: 1px solid #a6a6a6; +} body .p-datepicker .p-datepicker-buttonbar { border-top: 1px solid #d8dae2; } @@ -2584,6 +2590,17 @@ body .p-tree.p-tree-horizontal .p-treenode .p-treenode-content.p-treenode-select background-color: #eaeaea; color: #333333; } +body .p-tree .p-tree-filter-container .p-tree-filter { + width: 100%; + padding-right: 2em; +} +body .p-tree .p-tree-filter-container .p-tree-filter-icon { + top: 50%; + left: auto; + margin-top: -0.5em; + right: 0.8em; + color: #007ad9; +} body .p-organizationchart .p-organizationchart-node-content.p-organizationchart-selectable-node:not(.p-highlight):hover { background-color: #eaeaea; color: #333333; diff --git a/public/resources/themes/nova-dark/theme.css b/public/resources/themes/nova-dark/theme.css index 97e8c94330..d8d194aaf8 100644 --- a/public/resources/themes/nova-dark/theme.css +++ b/public/resources/themes/nova-dark/theme.css @@ -940,6 +940,9 @@ body .p-datepicker table { body .p-datepicker table th { padding: 0.5em; } +body .p-datepicker table th.p-datepicker-weekheader { + border-right: 1px solid #a6a6a6; +} body .p-datepicker table td { padding: 0.5em; } @@ -965,6 +968,9 @@ body .p-datepicker table td.p-datepicker-today > span.p-highlight { color: #ffffff; background-color: #007ad9; } +body .p-datepicker table td.p-datepicker-weeknumber { + border-right: 1px solid #a6a6a6; +} body .p-datepicker .p-datepicker-buttonbar { border-top: 1px solid #d8dae2; } @@ -2584,6 +2590,17 @@ body .p-tree.p-tree-horizontal .p-treenode .p-treenode-content.p-treenode-select background-color: #eaeaea; color: #333333; } +body .p-tree .p-tree-filter-container .p-tree-filter { + width: 100%; + padding-right: 2em; +} +body .p-tree .p-tree-filter-container .p-tree-filter-icon { + top: 50%; + left: auto; + margin-top: -0.5em; + right: 0.8em; + color: #007ad9; +} body .p-organizationchart .p-organizationchart-node-content.p-organizationchart-selectable-node:not(.p-highlight):hover { background-color: #eaeaea; color: #333333; diff --git a/public/resources/themes/nova-light/theme.css b/public/resources/themes/nova-light/theme.css index 9887acdae3..2ab91ed3b3 100644 --- a/public/resources/themes/nova-light/theme.css +++ b/public/resources/themes/nova-light/theme.css @@ -940,6 +940,9 @@ body .p-datepicker table { body .p-datepicker table th { padding: 0.5em; } +body .p-datepicker table th.p-datepicker-weekheader { + border-right: 1px solid #a6a6a6; +} body .p-datepicker table td { padding: 0.5em; } @@ -965,6 +968,9 @@ body .p-datepicker table td.p-datepicker-today > span.p-highlight { color: #ffffff; background-color: #007ad9; } +body .p-datepicker table td.p-datepicker-weeknumber { + border-right: 1px solid #a6a6a6; +} body .p-datepicker .p-datepicker-buttonbar { border-top: 1px solid #d8dae2; } @@ -2584,6 +2590,17 @@ body .p-tree.p-tree-horizontal .p-treenode .p-treenode-content.p-treenode-select background-color: #eaeaea; color: #333333; } +body .p-tree .p-tree-filter-container .p-tree-filter { + width: 100%; + padding-right: 2em; +} +body .p-tree .p-tree-filter-container .p-tree-filter-icon { + top: 50%; + left: auto; + margin-top: -0.5em; + right: 0.8em; + color: #007ad9; +} body .p-organizationchart .p-organizationchart-node-content.p-organizationchart-selectable-node:not(.p-highlight):hover { background-color: #eaeaea; color: #333333; diff --git a/public/resources/themes/rhea/theme.css b/public/resources/themes/rhea/theme.css index 25df6360e1..03bbbfb85a 100644 --- a/public/resources/themes/rhea/theme.css +++ b/public/resources/themes/rhea/theme.css @@ -940,6 +940,9 @@ body .p-datepicker table { body .p-datepicker table th { padding: 0.5em; } +body .p-datepicker table th.p-datepicker-weekheader { + border-right: 1px solid #dadada; +} body .p-datepicker table td { padding: 0.5em; } @@ -965,6 +968,9 @@ body .p-datepicker table td.p-datepicker-today > span.p-highlight { color: #ffffff; background-color: #7B95A3; } +body .p-datepicker table td.p-datepicker-weeknumber { + border-right: 1px solid #dadada; +} body .p-datepicker .p-datepicker-buttonbar { border-top: 1px solid #d8dae2; } @@ -2584,6 +2590,17 @@ body .p-tree.p-tree-horizontal .p-treenode .p-treenode-content.p-treenode-select background-color: #f4f4f4; color: #666666; } +body .p-tree .p-tree-filter-container .p-tree-filter { + width: 100%; + padding-right: 2em; +} +body .p-tree .p-tree-filter-container .p-tree-filter-icon { + top: 50%; + left: auto; + margin-top: -0.5em; + right: 0.8em; + color: #a6a6a6; +} body .p-organizationchart .p-organizationchart-node-content.p-organizationchart-selectable-node:not(.p-highlight):hover { background-color: #f4f4f4; color: #666666; diff --git a/src/components/calendar/Calendar.d.ts b/src/components/calendar/Calendar.d.ts index 6c98e89d1d..48fcf9879e 100644 --- a/src/components/calendar/Calendar.d.ts +++ b/src/components/calendar/Calendar.d.ts @@ -53,6 +53,7 @@ interface CalendarProps { stepSecond?: number; shortYearCutoff?: string; hideOnDateTimeSelect?: boolean; + showWeek: PropTypes.bool, locale?: LocaleSettings; dateFormat?: string; panelStyle?: object; diff --git a/src/components/calendar/Calendar.js b/src/components/calendar/Calendar.js index 5002af4d32..3d476f2023 100644 --- a/src/components/calendar/Calendar.js +++ b/src/components/calendar/Calendar.js @@ -42,6 +42,7 @@ export class Calendar extends Component { stepSecond: 1, shortYearCutoff: '+10', hideOnDateTimeSelect: false, + showWeek: false, locale: { firstDayOfWeek: 0, dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"], @@ -50,7 +51,8 @@ export class Calendar extends Component { monthNames: [ "January","February","March","April","May","June","July","August","September","October","November","December" ], monthNamesShort: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun","Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ], today: 'Today', - clear: 'Clear' + clear: 'Clear', + weekHeader: 'Wk' }, dateFormat: 'mm/dd/yy', panelStyle: null, @@ -117,6 +119,7 @@ export class Calendar extends Component { stepSecond: PropTypes.number, shortYearCutoff: PropTypes.string, hideOnDateTimeSelect: PropTypes.bool, + showWeek: PropTypes.bool, locale: PropTypes.object, dateFormat: PropTypes.string, panelStyle: PropTypes.object, @@ -938,6 +941,7 @@ export class Calendar extends Component { let prevMonthDaysLength = this.getDaysCountInPrevMonth(month, year); let dayNo = 1; let today = new Date(); + let weekNumbers = []; for(let i = 0; i < 6; i++) { let week = []; @@ -972,17 +976,31 @@ export class Calendar extends Component { dayNo++; } } + + if (this.props.showWeek) { + weekNumbers.push(this.getWeekNumber(new Date(week[0].year, week[0].month, week[0].day))); + } dates.push(week); } - + return { month: month, year: year, - dates: dates + dates: dates, + weekNumbers: weekNumbers }; } + getWeekNumber(date) { + let checkDate = new Date(date.getTime()); + checkDate.setDate(checkDate.getDate() + 4 - ( checkDate.getDay() || 7 )); + let time = checkDate.getTime(); + checkDate.setMonth( 0 ); + checkDate.setDate( 1 ); + return Math.floor( Math.round((time - checkDate.getTime()) / 86400000 ) / 7 ) + 1; + } + isSelectable(day, month, year, otherMonth) { let validMin = true; let validMax = true; @@ -1649,13 +1667,26 @@ export class Calendar extends Component { } renderDayNames(weekDays) { - return weekDays.map(weekDay => + const dayNames = weekDays.map(weekDay => (