Skip to content
This repository was archived by the owner on Jun 26, 2025. It is now read-only.

Commit 471a056

Browse files
author
Zach Plata
committed
Add chart configuration flag to disable same day dot styling on charts
1 parent 81dc701 commit 471a056

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

js/gc-chart-config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ window.GC = window.GC || {};
2424
// been stored on the server too)
2525
// =========================================================================
2626
var readOnlySettings = {
27-
fileRevision : 208,
27+
fileRevision : 210,
2828

2929
// See the toString method for the rendering template
3030
version : {
@@ -112,6 +112,8 @@ window.GC = window.GC || {};
112112
limit : 2
113113
},
114114

115+
sameDayDot: true,
116+
115117
// At what point chronologically does one start forecasting adult height?
116118
heightEstimatesMinAge : 12, // months
117119

js/gc-grid-view.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,22 +252,32 @@
252252

253253

254254
$.each(model, function( index, data ) {
255+
var useSameDayDot = GC.Preferences._data.sameDayDot;
256+
255257
//debugger;
256258
var age = new GC.TimeInterval(patient.DOB).setMonths(data.agemos),
257-
date = new XDate(patient.DOB.getTime()).addMonths(data.agemos),
258-
dateText = date.toString(GC.chartSettings.dateFormat);//,
259+
date = new XDate(patient.DOB.getTime()).addMonths(data.agemos);//,
259260
// years,
260261
// months,
261262
// days;
262263

264+
var sameDay = lastDate && lastDate.diffDays(date) < 1;
265+
var dateText = (useSameDayDot && sameDay) ?
266+
'<div style="text-align: center;font-size:20px">&bull;</div>' :
267+
date.toString(GC.chartSettings.dateFormat);
268+
263269
// Header - Date
264270
$('<th/>').append(
265271
$('<div class="date"/>').html(dateText)
266272
).appendTo(thr1);
267273

268274
// Header - Age
269275
$('<th/>').append(
270-
$('<div class=""/>').html(age.toString(shortDateFormat))
276+
$('<div class=""/>').html(
277+
(useSameDayDot && sameDay) ?
278+
date.toString(GC.chartSettings.timeFormat) :
279+
age.toString(shortDateFormat)
280+
)
271281
).appendTo(thr2);
272282

273283
$.each(scheme.header.rows, function(j, o) {

0 commit comments

Comments
 (0)