Revert timezone in timestamp

Removes the timezone from the timestamps, as the tooltip shows UTC
offset on mouseover.

Also upgrades most instances of gr-date-formatter to use gr-tooltip.

Bug: Issue 5587
Change-Id: I57c7dcacf0618ffd967eff3cb4ff37a5e1876180
This commit is contained in:
Kasper Nilsson
2017-02-28 14:58:20 -08:00
parent 537f74ee4f
commit bdf4390476
7 changed files with 11 additions and 14 deletions

View File

@@ -141,7 +141,9 @@ limitations under the License.
</td>
<td class="cell updated"
hidden$="[[isColumnHidden('Updated', visibleChangeTableColumns)]]">
<gr-date-formatter date-str="[[change.updated]]"></gr-date-formatter>
<gr-date-formatter
has-tooltip
date-str="[[change.updated]]"></gr-date-formatter>
</td>
<td class="cell size u-monospace"
hidden$="[[isColumnHidden('Size', visibleChangeTableColumns)]]">

View File

@@ -99,6 +99,7 @@ limitations under the License.
<span class="title">Updated</span>
<span class="value">
<gr-date-formatter
has-tooltip
date-str="[[change.updated]]"></gr-date-formatter>
</span>
</section>

View File

@@ -189,7 +189,9 @@ limitations under the License.
<span class="collapsedContent">[[comment.message]]</span>
</div>
<a class="date" href$="[[_computeLinkToComment(comment)]]" on-tap="_handleLinkTap">
<gr-date-formatter date-str="[[comment.updated]]"></gr-date-formatter>
<gr-date-formatter
has-tooltip
date-str="[[comment.updated]]"></gr-date-formatter>
</a>
<div class="show-hide">
<label class="show-hide">

View File

@@ -37,6 +37,7 @@ limitations under the License.
<span class="title">Registered</span>
<span class="value">
<gr-date-formatter
has-tooltip
date-str="[[_account.registered_on]]"></gr-date-formatter>
</span>
</section>

View File

@@ -157,8 +157,8 @@ limitations under the License.
<select
is="gr-select"
bind-value="{{_localPrefs.time_format}}">
<option value="HHMM_12">4:10 PM (PST)</option>
<option value="HHMM_24">16:10 (PST)</option>
<option value="HHMM_12">4:10 PM</option>
<option value="HHMM_24">16:10</option>
</select>
</span>
</section>

View File

@@ -65,10 +65,6 @@
this._loadPreferences();
},
_getTzString: function() {
return ' ' + new Date().toString().split(' ').pop();
},
_getUtcOffsetString: function() {
return ' UTC' + moment().format('Z');
},
@@ -150,7 +146,7 @@
var now = new Date();
var format = TimeFormats.MONTH_DAY_YEAR;
if (this._isWithinDay(now, date)) {
return date.format(timeFormat) + this._getTzString();
format = timeFormat;
} else if (this._isWithinHalfYear(now, date)) {
format = TimeFormats.MONTH_DAY;
}

View File

@@ -82,7 +82,6 @@ limitations under the License.
{time_format: 'HHMM_24', relative_date_in_change_table: false}
).then(function() {
element = fixture('basic');
sandbox.stub(element, '_getTzString').returns('');
sandbox.stub(element, '_getUtcOffsetString').returns('');
return element._loadPreferences();
});
@@ -125,7 +124,6 @@ limitations under the License.
{time_format: 'HHMM_12'}
).then(function() {
element = fixture('basic');
sandbox.stub(element, '_getTzString').returns('');
sandbox.stub(element, '_getUtcOffsetString').returns('');
return element._loadPreferences();
});
@@ -144,7 +142,6 @@ limitations under the License.
{time_format: 'HHMM_12', relative_date_in_change_table: true}
).then(function() {
element = fixture('basic');
sandbox.stub(element, '_getTzString').returns('');
sandbox.stub(element, '_getUtcOffsetString').returns('');
return element._loadPreferences();
});
@@ -169,7 +166,6 @@ limitations under the License.
{time_format: 'HHMM_12', relative_date_in_change_table: true}
).then(function() {
element = fixture('basic');
sandbox.stub(element, '_getTzString').returns('');
return element._loadPreferences();
});
});
@@ -184,7 +180,6 @@ limitations under the License.
setup(function() {
return stubRestAPI(null).then(function() {
element = fixture('basic');
sandbox.stub(element, '_getTzString').returns('');
return element._loadPreferences();
});
});