From 8c0599e30c8cfbda74f1f70e8b07e58bc19548ae Mon Sep 17 00:00:00 2001
From: Dan Vanderkam
Date: Wed, 5 Nov 2014 09:32:00 -0500
Subject: [PATCH] rename labelsDateUTC --> labelsUTC
---
auto_tests/tests/date_ticker.js | 4 ++--
dygraph-options-reference.js | 4 ++--
dygraph-tickers.js | 2 +-
dygraph.js | 8 ++++----
tests/labelsDateUTC.html | 4 ++--
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/auto_tests/tests/date_ticker.js b/auto_tests/tests/date_ticker.js
index 452db8a..be33b35 100644
--- a/auto_tests/tests/date_ticker.js
+++ b/auto_tests/tests/date_ticker.js
@@ -29,7 +29,7 @@ DateTickerTestCase.prototype.createOptionsViewForAxis = function(axis, dict) {
};
DateTickerTestCase.prototype.testBasicDateTicker = function() {
- var opts = {labelsDateUTC: true};
+ var opts = {labelsUTC: true};
var options = this.createOptionsViewForAxis('x', opts);
var ticks = Dygraph.dateTicker(-1797534000000, 1255579200000, 800, options);
@@ -68,7 +68,7 @@ DateTickerTestCase.prototype.testBasicDateTicker = function() {
};
DateTickerTestCase.prototype.testAllDateTickers = function() {
- var opts = {labelsDateUTC: true};
+ var opts = {labelsUTC: true};
var options = this.createOptionsViewForAxis('x', opts);
// For granularities finer than MONTHLY, the first tick returned tick
diff --git a/dygraph-options-reference.js b/dygraph-options-reference.js
index 0a1c390..60bd81e 100644
--- a/dygraph-options-reference.js
+++ b/dygraph-options-reference.js
@@ -486,9 +486,9 @@ Dygraph.OPTIONS_REFERENCE = //
"type": "boolean",
"description": "When set, display the graph as a step plot instead of a line plot. This option may either be set for the whole graph or for single series."
},
- "labelsDateUTC": {
+ "labelsUTC": {
"default": "false",
- "labels": ["Value display/formatting"],
+ "labels": ["Value display/formatting", "Axis display"],
"type": "boolean",
"description": "Show date/time labels according to UTC (instead of local time)."
},
diff --git a/dygraph-tickers.js b/dygraph-tickers.js
index 8818466..f23c87a 100644
--- a/dygraph-tickers.js
+++ b/dygraph-tickers.js
@@ -342,7 +342,7 @@ Dygraph.numDateTicks = function(start_time, end_time, granularity) {
Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
var formatter = /** @type{AxisLabelFormatter} */(
opts("axisLabelFormatter"));
- var utc = opts("labelsDateUTC");
+ var utc = opts("labelsUTC");
var accessors = utc ? Dygraph.DateAccessorsUTC : Dygraph.DateAccessorsLocal;
var datefield = Dygraph.TICK_PLACEMENT[granularity].datefield;
diff --git a/dygraph.js b/dygraph.js
index 7dd68a9..bba1028 100644
--- a/dygraph.js
+++ b/dygraph.js
@@ -203,7 +203,7 @@ Dygraph.SHORT_MONTH_NAMES_ = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', '
/**
* Convert a JS date to a string appropriate to display on an axis that
* is displaying values at the stated granularity. This respects the
- * labelsDateUTC option.
+ * labelsUTC option.
* @param {Date} date The date to format
* @param {number} granularity One of the Dygraph granularity constants
* @param {Dygraph} opts An options view
@@ -211,7 +211,7 @@ Dygraph.SHORT_MONTH_NAMES_ = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', '
* @private
*/
Dygraph.dateAxisLabelFormatter = function(date, granularity, opts) {
- var utc = opts('labelsDateUTC');
+ var utc = opts('labelsUTC');
var accessors = utc ? Dygraph.DateAccessorsUTC : Dygraph.DateAccessorsLocal;
var year = accessors.getFullYear(date),
@@ -241,13 +241,13 @@ Dygraph.dateAxisFormatter = Dygraph.dateAxisLabelFormatter;
/**
* Return a string version of a JS date for a value label. This respects the
- * labelsDateUTC option.
+ * labelsUTC option.
* @param {Date} date The date to be formatted
* @param {Dygraph} opts An options view
* @private
*/
Dygraph.dateValueFormatter = function(d, opts) {
- return Dygraph.dateString_(d, opts('labelsDateUTC'));
+ return Dygraph.dateString_(d, opts('labelsUTC'));
};
/**
diff --git a/tests/labelsDateUTC.html b/tests/labelsDateUTC.html
index a4abfc3..3835f81 100644
--- a/tests/labelsDateUTC.html
+++ b/tests/labelsDateUTC.html
@@ -17,7 +17,7 @@
UTC date and time labels
This shows how date ticks and labels may be generated according to local
- time (default) or UTC with the option labelsDateUTC
.
+ time (default) or UTC with the option labelsUTC
.
72 hours of random hourly data since 2009-Jul-23 18:00 UTC
according to local time (top) and UTC (bottom):
@@ -54,7 +54,7 @@
document.getElementById("div_utc"),
data,
{
- labelsDateUTC: true,
+ labelsUTC: true,
labels: ['UTC', 'random']
}
);
--
2.7.4