summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/Date.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/Date.js') (more/less context) (show whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/Date.js25
1 files changed, 10 insertions, 15 deletions
diff --git a/frontend/gamma/js/Clipperz/Date.js b/frontend/gamma/js/Clipperz/Date.js
index 020d77b..163790e 100644
--- a/frontend/gamma/js/Clipperz/Date.js
+++ b/frontend/gamma/js/Clipperz/Date.js
@@ -1,34 +1,32 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
26if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } 24if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
27if (typeof(Clipperz.Date) == 'undefined') { Clipperz.Date = {}; } 25if (typeof(Clipperz.Date) == 'undefined') { Clipperz.Date = {}; }
28 26
29Clipperz.Date.VERSION = "0.1"; 27Clipperz.Date.VERSION = "0.1";
30Clipperz.Date.NAME = "Clipperz.Date"; 28Clipperz.Date.NAME = "Clipperz.Date";
31 29
32MochiKit.Base.update(Clipperz.Date, { 30MochiKit.Base.update(Clipperz.Date, {
33 31
34 //------------------------------------------------------------------------- 32 //-------------------------------------------------------------------------
@@ -230,52 +228,49 @@ MochiKit.Base.update(Clipperz.Date, {
230 228
231 return result; 229 return result;
232 }, 230 },
233 231
234 //========================================================================= 232 //=========================================================================
235 233
236 'formatDateWithPHPLikeTemplateAndLocale': function(aDate, aFormat, aLocale) { 234 'formatDateWithPHPLikeTemplateAndLocale': function(aDate, aFormat, aLocale) {
237 var result; 235 var result;
238 var formatterCode; 236 var formatterCode;
239 var formatter; 237 var formatter;
240 var i,c; 238 var i,c;
241 239
242//MochiKit.Logging.logDebug(">>> Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale");
243 formatterCode = "Clipperz.Date.__scratchFormatter = function(aDate, aLocale){return ''"; 240 formatterCode = "Clipperz.Date.__scratchFormatter = function(aDate, aLocale){return ''";
244 241
245 c = aFormat.length; 242 c = aFormat.length;
246 i = 0; 243 i = 0;
247 244
248 while (i<c) { 245 while (i<c) {
249 var character; 246 var character;
250 247
251 character = aFormat.charAt(i); 248 character = aFormat.charAt(i);
252 if (character == "\\") { 249 if (character == "\\") {
253 i++; 250 i++;
254 character = aFormat.charAt(i); 251 character = aFormat.charAt(i);
255 formatterCode += " + '" + character + "'" 252 formatterCode += " + '" + character + "'"
256 } else { 253 } else {
257 formatterCode += Clipperz.Date.getPHPLikeFormatCode(character); 254 formatterCode += Clipperz.Date.getPHPLikeFormatCode(character);
258 } 255 }
259 256
260 i++; 257 i++;
261 } 258 }
262 259
263 formatterCode += ";}"; 260 formatterCode += ";}";
264//MochiKit.Logging.logDebug("--- Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale - formatterCode: " + formatterCode);
265 eval(formatterCode); 261 eval(formatterCode);
266 262
267 result = Clipperz.Date.__scratchFormatter.call(this, aDate, aLocale); 263 result = Clipperz.Date.__scratchFormatter.call(this, aDate, aLocale);
268 delete Clipperz.Date.__scratchFormatter; 264 delete Clipperz.Date.__scratchFormatter;
269//MochiKit.Logging.logDebug("<<< Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale");
270 265
271 return result; 266 return result;
272 }, 267 },
273 268
274 //------------------------------------------------------------------------- 269 //-------------------------------------------------------------------------
275 270
276 'parseDateWithPHPLikeTemplateAndLocale': function(aString, aFormat, aLocale) { 271 'parseDateWithPHPLikeTemplateAndLocale': function(aString, aFormat, aLocale) {
277 return new Date(); 272 return new Date();
278 }, 273 },
279 274
280 //========================================================================= 275 //=========================================================================
281 276