From 0ade49f938947801a4faf024cbcf136865efd218 Mon Sep 17 00:00:00 2001 From: Sarah Kuehnle Date: Mon, 12 Jan 2015 15:15:29 -0500 Subject: [PATCH 1/4] Abbreviates dates in the patient data charts and removes large block element around date to bring arrows in closer to dates. --- app/components/chart/daily.js | 10 +++++----- app/components/chart/modal.js | 10 +++++----- app/components/chart/weekly.js | 10 +++++----- app/pages/patientdata/patientdata.less | 2 -- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/app/components/chart/daily.js b/app/components/chart/daily.js index 6f21b35369..17d37fedc4 100644 --- a/app/components/chart/daily.js +++ b/app/components/chart/daily.js @@ -1,16 +1,16 @@ /** @jsx React.DOM */ -/* +/* * == BSD2 LICENSE == * Copyright (c) 2014, Tidepool Project - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the associated License, which is identical to the BSD 2-Clause * License as published by the Open Source Initiative at opensource.org. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the License for more details. - * + * * You should have received a copy of the License along with this program; if * not, you can obtain one from Tidepool Project at tidepool.org. * == BSD2 LICENSE == @@ -117,7 +117,7 @@ var Daily = React.createClass({ else { timezone = timePrefs.timezoneName || 'UTC'; } - return sundial.formatInTimezone(datetime, timezone, 'dddd, MMMM Do'); + return sundial.formatInTimezone(datetime, timezone, 'ddd, MMM Do'); }, // handlers handleClickModal: function(e) { diff --git a/app/components/chart/modal.js b/app/components/chart/modal.js index 54fa917b63..cd373e7bc7 100644 --- a/app/components/chart/modal.js +++ b/app/components/chart/modal.js @@ -1,16 +1,16 @@ /** @jsx React.DOM */ -/* +/* * == BSD2 LICENSE == * Copyright (c) 2014, Tidepool Project - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the associated License, which is identical to the BSD 2-Clause * License as published by the Open Source Initiative at opensource.org. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the License for more details. - * + * * You should have received a copy of the License along with this program; if * not, you can obtain one from Tidepool Project at tidepool.org. * == BSD2 LICENSE == @@ -186,7 +186,7 @@ var Modal = React.createClass({ else { timezone = timePrefs.timezoneName || 'UTC'; } - return sundial.formatInTimezone(datetime, timezone, 'MMMM Do'); + return sundial.formatInTimezone(datetime, timezone, 'MMM Do'); }, getTitle: function(datetimeLocationEndpoints) { // endpoint is exclusive, so need to subtract a day diff --git a/app/components/chart/weekly.js b/app/components/chart/weekly.js index 5addd76547..cb5f1332b2 100644 --- a/app/components/chart/weekly.js +++ b/app/components/chart/weekly.js @@ -1,16 +1,16 @@ /** @jsx React.DOM */ -/* +/* * == BSD2 LICENSE == * Copyright (c) 2014, Tidepool Project - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the associated License, which is identical to the BSD 2-Clause * License as published by the Open Source Initiative at opensource.org. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the License for more details. - * + * * You should have received a copy of the License along with this program; if * not, you can obtain one from Tidepool Project at tidepool.org. * == BSD2 LICENSE == @@ -161,7 +161,7 @@ var Weekly = React.createClass({ }, formatDate: function(datetime) { // even when timezoneAware, labels should be generated as if UTC; just trust me (JEB) - return sundial.formatInTimezone(datetime, 'UTC', 'MMMM Do'); + return sundial.formatInTimezone(datetime, 'UTC', 'MMM Do'); }, getTitle: function(datetimeLocationEndpoints) { return this.formatDate(datetimeLocationEndpoints[0]) + ' - ' + this.formatDate(datetimeLocationEndpoints[1]); diff --git a/app/pages/patientdata/patientdata.less b/app/pages/patientdata/patientdata.less index f8175e7db1..61ed542f5c 100644 --- a/app/pages/patientdata/patientdata.less +++ b/app/pages/patientdata/patientdata.less @@ -39,8 +39,6 @@ } .patient-data-subnav-text-dates { - width: 275px; - padding-left: 0; padding-right: 0; } From b5c6e9b6c7968ad83902ddb5c53fd0df565b0ea4 Mon Sep 17 00:00:00 2001 From: Sarah Kuehnle Date: Mon, 12 Jan 2015 18:03:37 -0500 Subject: [PATCH 2/4] Adds year to abbreviated date and removes jiggle from arrow buttons. --- app/components/chart/daily.js | 2 +- app/components/chart/header.js | 17 ++++++++++++----- app/components/chart/modal.js | 2 +- app/components/chart/weekly.js | 2 +- app/pages/patientdata/patientdata.less | 15 +++++++++++---- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/app/components/chart/daily.js b/app/components/chart/daily.js index 17d37fedc4..927073f589 100644 --- a/app/components/chart/daily.js +++ b/app/components/chart/daily.js @@ -117,7 +117,7 @@ var Daily = React.createClass({ else { timezone = timePrefs.timezoneName || 'UTC'; } - return sundial.formatInTimezone(datetime, timezone, 'ddd, MMM Do'); + return sundial.formatInTimezone(datetime, timezone, 'ddd, MMM D, YYYY'); }, // handlers handleClickModal: function(e) { diff --git a/app/components/chart/header.js b/app/components/chart/header.js index ab9db8426b..a2959c939a 100644 --- a/app/components/chart/header.js +++ b/app/components/chart/header.js @@ -1,16 +1,16 @@ /** @jsx React.DOM */ -/* +/* * == BSD2 LICENSE == * Copyright (c) 2014, Tidepool Project - * + * * This program is free software; you can redistribute it and/or modify it under * the terms of the associated License, which is identical to the BSD 2-Clause * License as published by the Open Source Initiative at opensource.org. - * + * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the License for more details. - * + * * You should have received a copy of the License along with this program; if * not, you can obtain one from Tidepool Project at tidepool.org. * == BSD2 LICENSE == @@ -53,6 +53,13 @@ var TidelineHeader = React.createClass({ 'patient-data-subnav-hidden': this.props.chartType === 'no-data' }); + var dateLinkClass = cx({ + 'patient-data-subnav-text' : this.props.chartType === 'daily' || this.props.chartType === 'weekly' || this.props.chartType === 'modal', + 'patient-data-subnav-dates-daily': this.props.chartType === 'daily', + 'patient-data-subnav-dates-weekly': this.props.chartType === 'weekly', + 'patient-data-subnav-dates-modal': this.props.chartType === 'modal' + }); + var mostRecentLinkClass = cx({ 'patient-data-subnav-active': !this.props.atMostRecent && !this.props.inTransition, 'patient-data-subnav-disabled': this.props.atMostRecent || this.props.inTransition, @@ -93,7 +100,7 @@ var TidelineHeader = React.createClass({
-
+
{this.props.title}
diff --git a/app/components/chart/modal.js b/app/components/chart/modal.js index cd373e7bc7..eb4c92372c 100644 --- a/app/components/chart/modal.js +++ b/app/components/chart/modal.js @@ -186,7 +186,7 @@ var Modal = React.createClass({ else { timezone = timePrefs.timezoneName || 'UTC'; } - return sundial.formatInTimezone(datetime, timezone, 'MMM Do'); + return sundial.formatInTimezone(datetime, timezone, 'MMM D, YYYY'); }, getTitle: function(datetimeLocationEndpoints) { // endpoint is exclusive, so need to subtract a day diff --git a/app/components/chart/weekly.js b/app/components/chart/weekly.js index cb5f1332b2..c610876964 100644 --- a/app/components/chart/weekly.js +++ b/app/components/chart/weekly.js @@ -161,7 +161,7 @@ var Weekly = React.createClass({ }, formatDate: function(datetime) { // even when timezoneAware, labels should be generated as if UTC; just trust me (JEB) - return sundial.formatInTimezone(datetime, 'UTC', 'MMM Do'); + return sundial.formatInTimezone(datetime, 'UTC', 'MMM D, YYYY'); }, getTitle: function(datetimeLocationEndpoints) { return this.formatDate(datetimeLocationEndpoints[0]) + ' - ' + this.formatDate(datetimeLocationEndpoints[1]); diff --git a/app/pages/patientdata/patientdata.less b/app/pages/patientdata/patientdata.less index 61ed542f5c..d21cc574ec 100644 --- a/app/pages/patientdata/patientdata.less +++ b/app/pages/patientdata/patientdata.less @@ -33,14 +33,21 @@ .patient-data-subnav-text { display: inline-block; - padding: @patient-data-subnav-vertical-padding @patient-data-subnav-horizontal-padding; + padding: @patient-data-subnav-vertical-padding 0 @patient-data-subnav-horizontal-padding 0; text-align: center; } -.patient-data-subnav-text-dates { - padding-left: 0; - padding-right: 0; +.patient-data-subnav-dates-daily { + width: 150px; +} + +.patient-data-subnav-dates-weekly { + width: 220px; +} + +.patient-data-subnav-dates-modal { + width: 275px; } .patient-data-subnav a { From bbd63855a51aa5cd2aa40440a08f9b7fbf27d715 Mon Sep 17 00:00:00 2001 From: Sarah Kuehnle Date: Tue, 13 Jan 2015 14:07:46 -0500 Subject: [PATCH 3/4] Fixes veritcal width of chart header for all views. --- app/pages/patientdata/patientdata.less | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/pages/patientdata/patientdata.less b/app/pages/patientdata/patientdata.less index d21cc574ec..645b5c7280 100644 --- a/app/pages/patientdata/patientdata.less +++ b/app/pages/patientdata/patientdata.less @@ -27,13 +27,14 @@ color: #fff; background-color: @gray-dark; - padding-left: 0; - padding-right: 0; + // padding-left: 0; + // padding-right: 0; + padding: @patient-data-subnav-vertical-padding 0 @patient-data-subnav-horizontal-padding 0; } .patient-data-subnav-text { display: inline-block; - padding: @patient-data-subnav-vertical-padding 0 @patient-data-subnav-horizontal-padding 0; + // padding: @patient-data-subnav-vertical-padding 0 @patient-data-subnav-horizontal-padding 0; text-align: center; } @@ -52,7 +53,7 @@ .patient-data-subnav a { display: inline-block; - padding: @patient-data-subnav-vertical-padding @patient-data-subnav-horizontal-padding; + padding: 0 @patient-data-subnav-vertical-padding 0 @patient-data-subnav-horizontal-padding; color: #fff; text-decoration: none; From 09bec0260a4e2f617dda933c03cc8f3da7c09f94 Mon Sep 17 00:00:00 2001 From: Sarah Kuehnle Date: Tue, 13 Jan 2015 17:55:40 -0500 Subject: [PATCH 4/4] Removes commented out code. --- app/pages/patientdata/patientdata.less | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/pages/patientdata/patientdata.less b/app/pages/patientdata/patientdata.less index 1716ec2459..922097b890 100644 --- a/app/pages/patientdata/patientdata.less +++ b/app/pages/patientdata/patientdata.less @@ -27,14 +27,11 @@ color: #fff; background-color: @gray-dark; - // padding-left: 0; - // padding-right: 0; padding: @patient-data-subnav-vertical-padding 0 @patient-data-subnav-horizontal-padding 0; } .patient-data-subnav-text { display: inline-block; - // padding: @patient-data-subnav-vertical-padding 0 @patient-data-subnav-horizontal-padding 0; text-align: center; }