设置日期范围过滤器

时间:2014-10-24 02:14:28

标签: date filter

我在学习过程中。我写了这个程序。在表格视图中,日期格式太长显示日期甚至秒。在表格视图中,我只想显示例如日期和月份。 10/23 请帮忙。

function doGet() {

  var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/16kZE9gQY1hIczYH7U9z6t77mSEZpPasENynG4_M0ERk/edit?usp=sharing');
  var data = ss.getDataRange();

  var loadfilter = Charts.newStringFilter().setFilterColumnIndex(4).build();
  var truckfilter = Charts.newStringFilter().setFilterColumnIndex(0).build();
  var statusfilter = Charts.newCategoryFilter().setFilterColumnIndex(6).build();
  var datefilter = Charts.newNumberRangeFilter().setFilterColumnLabel("Delivery").build();

  var tablechart = Charts.newTableChart().setDataViewDefinition(Charts.newDataViewDefinition().setColumns([0, 1, 2, 3, 4, 5, 6, 7])).setDimensions(1200, 800).build();

  var dashboard = Charts.newDashboardPanel().setDataTable(data).bind([loadfilter, truckfilter, statusfilter, datefilter], [tablechart]).build();

  var app = UiApp.createApplication();
  var filterpanel = app.createHorizontalPanel();
  var tablepanel = app.createHorizontalPanel();

  filterpanel.add(loadfilter).add(truckfilter).add(statusfilter).add(datefilter).setSpacing(30);
  tablepanel.add(tablechart);
  dashboard.add(app.createVerticalPanel().add(filterpanel).add(tablepanel));

  app.add(dashboard);
  return app;

}

0 个答案:

没有答案