~bcsaller/juju-gui/update-reductions

« back to all changes in this revision

Viewing changes to lib/d3/src/time/format-utc.js

  • Committer: kapil.foss at gmail
  • Date: 2012-07-13 18:45:59 UTC
  • Revision ID: kapil.foss@gmail.com-20120713184559-2xl7be17egsrz0c9
reshape

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
d3.time.format.utc = function(template) {
2
 
  var local = d3.time.format(template);
3
 
 
4
 
  function format(date) {
5
 
    try {
6
 
      d3_time = d3_time_utc;
7
 
      var utc = new d3_time();
8
 
      utc._ = date;
9
 
      return local(utc);
10
 
    } finally {
11
 
      d3_time = Date;
12
 
    }
13
 
  }
14
 
 
15
 
  format.parse = function(string) {
16
 
    try {
17
 
      d3_time = d3_time_utc;
18
 
      var date = local.parse(string);
19
 
      return date && date._;
20
 
    } finally {
21
 
      d3_time = Date;
22
 
    }
23
 
  };
24
 
 
25
 
  format.toString = local.toString;
26
 
 
27
 
  return format;
28
 
};