Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: i18n.js

Issue 29333819: Issue 2375 - Implement "Blocking lists" section in new options page (Closed)
Left Patch Set: Created Jan. 29, 2016, 6:54 p.m.
Right Patch Set: Fixed the progress indicator and small fixes Created Feb. 4, 2016, 5:43 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 var d = new Date(when); 97 var d = new Date(when);
98 var timeString = d.toLocaleTimeString(); 98 var timeString = d.toLocaleTimeString();
99 99
100 var now = new Date(); 100 var now = new Date();
101 if (d.toDateString() == now.toDateString()) 101 if (d.toDateString() == now.toDateString())
102 return [timeString]; 102 return [timeString];
103 else 103 else
104 return [timeString, d.toLocaleDateString()]; 104 return [timeString, d.toLocaleDateString()];
105 } 105 }
106 106
107 // Formats date string to ["yyyy-mm-dd", "mm:ss"] format 107 // Formats date string to ["YYYY-MM-DD", "mm:ss"] format
Thomas Greiner 2016/02/01 18:52:35 Detail: Usually, you would write it as "YYYY-MM-DD
saroyanm 2016/02/03 14:04:25 Done.
108 function i18n_formatDateTime(when) 108 function i18n_formatDateTime(when)
109 { 109 {
110 var date = new Date(when); 110 var date = new Date(when);
111 var dateParts = [date.getFullYear(), date.getMonth() + 1, date.getDate(), 111 var dateParts = [date.getFullYear(), date.getMonth() + 1, date.getDate(),
112 date.getHours(), date.getMinutes()]; 112 date.getHours(), date.getMinutes()];
113 113
114 var dateParts = dateParts.map(function(datePart) 114 var dateParts = dateParts.map(function(datePart)
115 { 115 {
116 return datePart < 10 ? "0" + datePart : datePart; 116 return datePart < 10 ? "0" + datePart : datePart;
117 }); 117 });
118 118
119 return [dateParts.splice(0, 3).join("-"), dateParts.join(":")]; 119 return [dateParts.splice(0, 3).join("-"), dateParts.join(":")];
120 } 120 }
121 121
122 // Fill in the strings as soon as possible 122 // Fill in the strings as soon as possible
123 window.addEventListener("DOMContentLoaded", loadI18nStrings, true); 123 window.addEventListener("DOMContentLoaded", loadI18nStrings, true);
LEFTRIGHT

Powered by Google App Engine
This is Rietveld