Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2691)

Unified Diff: bower_components/chartnewjs/Add-ins/format.js

Issue 786953007: npm_modules: Fork bower_components into Polymer 0.4.0 and 0.5.0 versions (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bower_components/chartnewjs/.bower.json ('k') | bower_components/chartnewjs/Add-ins/gradientColor.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bower_components/chartnewjs/Add-ins/format.js
diff --git a/bower_components/chartnewjs/Add-ins/format.js b/bower_components/chartnewjs/Add-ins/format.js
deleted file mode 100644
index 12debdf442c381ab595bd197095ef0a02af52a54..0000000000000000000000000000000000000000
--- a/bower_components/chartnewjs/Add-ins/format.js
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// Additional formats for ChartNew.js
-//
-// see https://github.com/FVANCOP/ChartNew.js/wiki/900_010_format.js
-//
-function fmtChartJSPerso(config, value, fmt) {
- switch (fmt.split(/[\s,]+/)[0].toUpperCase()) {
- case "DATE":
- spltdt = fmt.replace(/,/g, " ").replace(/:/g, " ").split(/[\s,]+/);
- var options = new Array();
- for (var i = 1; i < spltdt.length; i++) {
- switch (spltdt[i].toUpperCase()) {
- case "WEEKDAY":
- case "YEAR":
- case "MONTH":
- case "DAY":
- options[spltdt[i]] = spltdt[i + 1];
- break;
- default:
- break;
- }
- }
- return_value = value.toLocaleDateString(fmt.split(" ")[1], options);
- break;
- case "FMTDATE":
- spltdt = fmt.split(/[\s,]+/)[1].toUpperCase();
- return_value = spltdt.replaceArray(["DD", "MM", "YYYY", "YY"], [value.getDate(), 1 + value.getMonth(), value.getFullYear(), value.getYear() % 100]);
- break;
- case "TIME":
- return_value = value.toLocaleTimeString();
- break;
- case "FMTTIME":
- spltdt = fmt.split(/[\s,]+/)[1].toUpperCase();
- return_value = spltdt.replaceArray(["HH", "MM", "SS"], [
- value.getHours() < 10 ? '0' + value.getHours() : value.getHours(),
- value.getMinutes() < 10 ? '0' + value.getMinutes() : value.getMinutes(),
- value.getSeconds() < 10 ? '0' + value.getSeconds() : value.getSeconds()
- ]);
- break;
- case "FMTDATETIME":
- spltdt = fmt.splitLimit(/[\s,]+/, 2)[1];
- return_value = spltdt.replaceArray(["DD", "MM", "YYYY", "YY", "HH", "mm", "ss"], [
- value.getDate(), 1 + value.getMonth(), value.getFullYear(), value.getYear() % 100,
- value.getHours() < 10 ? '0' + value.getHours() : value.getHours(),
- value.getMinutes() < 10 ? '0' + value.getMinutes() : value.getMinutes(),
- value.getSeconds() < 10 ? '0' + value.getSeconds() : value.getSeconds()
- ]);
- break;
- default:
- return_value = value;
- break;
- }
- return (return_value);
-}
-String.prototype.replaceArray = function(find, replace) {
- var replaceString = this;
- var regex;
- for (var i = 0; i < find.length; i++) {
- regex = new RegExp(find[i], "g");
- replaceString = replaceString.replace(regex, replace[i]);
- }
- return replaceString;
-};
-/**
- * split a string into an array with limit entries
- * The last entry contains the last part of the string, which can contain the separator)
- * @param separator {string} string separator
- * @param limit {integer} number of entries in the array
- * @return array of separated strings
- */
-String.prototype.splitLimit = function(separator, limit) {
- var splitString = this;
- var result = [];
- var pos = splitString.search(separator);
- if (pos < 0) return false;
- result.push(splitString.substring(0, pos));
- result.push(splitString.substring(pos + 1));
- return result;
-}
« no previous file with comments | « bower_components/chartnewjs/.bower.json ('k') | bower_components/chartnewjs/Add-ins/gradientColor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698