|
1 | 1 | <?php |
2 | 2 |
|
3 | | -use function PHP81_BC\strftime; |
| 3 | +use Horde\Date\Format; |
4 | 4 |
|
5 | 5 | /** |
6 | 6 | * Preferences Information |
|
427 | 427 | ]; |
428 | 428 |
|
429 | 429 | $_prefs['date_format'] = [ |
430 | | - 'value' => '%x', |
| 430 | + 'value' => 'short', |
431 | 431 | 'type' => 'enum', |
432 | 432 | 'enum' => [ |
433 | | - '%x' => strftime('%x'), |
434 | | - '%Y-%m-%d' => strftime('%Y-%m-%d'), |
435 | | - '%d/%m/%Y' => strftime('%d/%m/%Y'), |
436 | | - '%A, %B %d, %Y' => strftime('%A, %B %d, %Y'), |
437 | | - '%A, %d. %B %Y' => strftime('%A, %d. %B %Y'), |
438 | | - '%A, %d %B %Y' => strftime('%A, %d %B %Y'), |
439 | | - '%a, %b %e, %Y' => strftime('%a, %b %e, %Y'), |
440 | | - '%a, %b %e, %y' => strftime('%a, %b %e, %y'), |
441 | | - '%a, %b %e' => strftime('%a, %b %e'), |
442 | | - '%a, %e %b %Y' => strftime('%a, %e %b %Y'), |
443 | | - '%a, %e %b %y' => strftime('%a, %e %b %y'), |
444 | | - '%a %d %b %Y' => strftime('%a %d %b %Y'), |
445 | | - '%a %x' => strftime('%a %x'), |
446 | | - '%a %Y-%m-%d' => strftime('%a %Y-%m-%d'), |
447 | | - '%e %b %Y' => strftime('%e %b %Y'), |
448 | | - '%e. %b %Y' => strftime('%e. %b %Y'), |
449 | | - '%e. %m %Y' => strftime('%e %m %Y'), |
450 | | - '%e. %m.' => strftime('%e. %m.'), |
451 | | - '%e. %B' => strftime('%e. %B'), |
452 | | - '%e. %B %Y' => strftime('%e. %B %Y'), |
453 | | - '%e. %B %y' => strftime('%e. %B %y'), |
454 | | - '%B %e, %Y' => strftime('%B %e, %Y'), |
| 433 | + 'short' => Format::formatDate(time(), 'short', $GLOBALS['language'] ?? 'en_US'), |
| 434 | + 'yyyy-MM-dd' => Format::formatDate(time(), 'yyyy-MM-dd', $GLOBALS['language'] ?? 'en_US'), |
| 435 | + 'dd/MM/yyyy' => Format::formatDate(time(), 'dd/MM/yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 436 | + 'EEEE, MMMM dd, yyyy' => Format::formatDate(time(), 'EEEE, MMMM dd, yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 437 | + 'EEEE, dd. MMMM yyyy' => Format::formatDate(time(), 'EEEE, dd. MMMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 438 | + 'EEEE, dd MMMM yyyy' => Format::formatDate(time(), 'EEEE, dd MMMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 439 | + 'EEE, MMM d, yyyy' => Format::formatDate(time(), 'EEE, MMM d, yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 440 | + 'EEE, MMM d, yy' => Format::formatDate(time(), 'EEE, MMM d, yy', $GLOBALS['language'] ?? 'en_US'), |
| 441 | + 'EEE, MMM d' => Format::formatDate(time(), 'EEE, MMM d', $GLOBALS['language'] ?? 'en_US'), |
| 442 | + 'EEE, d MMM yyyy' => Format::formatDate(time(), 'EEE, d MMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 443 | + 'EEE, d MMM yy' => Format::formatDate(time(), 'EEE, d MMM yy', $GLOBALS['language'] ?? 'en_US'), |
| 444 | + 'EEE dd MMM yyyy' => Format::formatDate(time(), 'EEE dd MMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 445 | + 'd MMM yyyy' => Format::formatDate(time(), 'd MMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 446 | + 'd. MMM yyyy' => Format::formatDate(time(), 'd. MMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 447 | + 'd. MM yyyy' => Format::formatDate(time(), 'd. MM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 448 | + 'd. MM.' => Format::formatDate(time(), 'd. MM.', $GLOBALS['language'] ?? 'en_US'), |
| 449 | + 'd. MMMM' => Format::formatDate(time(), 'd. MMMM', $GLOBALS['language'] ?? 'en_US'), |
| 450 | + 'd. MMMM yyyy' => Format::formatDate(time(), 'd. MMMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 451 | + 'd. MMMM yy' => Format::formatDate(time(), 'd. MMMM yy', $GLOBALS['language'] ?? 'en_US'), |
| 452 | + 'MMMM d, yyyy' => Format::formatDate(time(), 'MMMM d, yyyy', $GLOBALS['language'] ?? 'en_US'), |
455 | 453 | ], |
456 | 454 | 'desc' => _("Choose how to display dates (full format):"), |
457 | 455 | ]; |
458 | 456 |
|
459 | 457 | $_prefs['date_format_mini'] = [ |
460 | | - 'value' => '%x', |
| 458 | + 'value' => 'short', |
461 | 459 | 'type' => 'enum', |
462 | 460 | 'enum' => [ |
463 | | - '%x' => strftime('%x'), |
464 | | - '%Y-%m-%d' => strftime('%Y-%m-%d'), |
465 | | - '%d/%m/%Y' => strftime('%d/%m/%Y'), |
466 | | - '%a, %b %e, %Y' => strftime('%a, %b %e, %Y'), |
467 | | - '%a, %b %e, %y' => strftime('%a, %b %e, %y'), |
468 | | - '%a, %b %e' => strftime('%a, %b %e'), |
469 | | - '%a, %e %b %Y' => strftime('%a, %e %b %Y'), |
470 | | - '%a, %e %b %y' => strftime('%a, %e %b %y'), |
471 | | - '%a %d %b %Y' => strftime('%a %d %b %Y'), |
472 | | - '%a %x' => strftime('%a %x'), |
473 | | - '%a %Y-%m-%d' => strftime('%a %Y-%m-%d'), |
474 | | - '%e %b %Y' => strftime('%e %b %Y'), |
475 | | - '%e. %b %Y' => strftime('%e. %b %Y'), |
476 | | - '%e. %m %Y' => strftime('%e %m %Y'), |
477 | | - '%e. %m.' => strftime('%e. %m.'), |
478 | | - '%b %e, %Y' => strftime('%b %e, %Y'), |
| 461 | + 'short' => Format::formatDate(time(), 'short', $GLOBALS['language'] ?? 'en_US'), |
| 462 | + 'yyyy-MM-dd' => Format::formatDate(time(), 'yyyy-MM-dd', $GLOBALS['language'] ?? 'en_US'), |
| 463 | + 'dd/MM/yyyy' => Format::formatDate(time(), 'dd/MM/yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 464 | + 'EEE, MMM d, yyyy' => Format::formatDate(time(), 'EEE, MMM d, yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 465 | + 'EEE, MMM d, yy' => Format::formatDate(time(), 'EEE, MMM d, yy', $GLOBALS['language'] ?? 'en_US'), |
| 466 | + 'EEE, MMM d' => Format::formatDate(time(), 'EEE, MMM d', $GLOBALS['language'] ?? 'en_US'), |
| 467 | + 'EEE, d MMM yyyy' => Format::formatDate(time(), 'EEE, d MMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 468 | + 'EEE, d MMM yy' => Format::formatDate(time(), 'EEE, d MMM yy', $GLOBALS['language'] ?? 'en_US'), |
| 469 | + 'EEE dd MMM yyyy' => Format::formatDate(time(), 'EEE dd MMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 470 | + 'd MMM yyyy' => Format::formatDate(time(), 'd MMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 471 | + 'd. MMM yyyy' => Format::formatDate(time(), 'd. MMM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 472 | + 'd. MM yyyy' => Format::formatDate(time(), 'd. MM yyyy', $GLOBALS['language'] ?? 'en_US'), |
| 473 | + 'd. MM.' => Format::formatDate(time(), 'd. MM.', $GLOBALS['language'] ?? 'en_US'), |
| 474 | + 'MMM d, yyyy' => Format::formatDate(time(), 'MMM d, yyyy', $GLOBALS['language'] ?? 'en_US'), |
479 | 475 | ], |
480 | 476 | 'desc' => _("Choose how to display dates (abbreviated format):"), |
481 | 477 | ]; |
482 | 478 |
|
483 | 479 | $_prefs['time_format'] = [ |
484 | | - 'value' => '%X', |
| 480 | + 'value' => 'h:mm:ss a', |
485 | 481 | 'type' => 'enum', |
486 | 482 | 'enum' => [ |
487 | | - '%X' => strftime('%X') . ' (' . _("Default") . ')', |
488 | | - '%H:%M:%S' => strftime('%H:%M:%S') . ' (' . _("24-hour format") . ')', |
489 | | - '%l:%M:%S %p' => strftime('%l:%M:%S %p'), |
| 483 | + 'h:mm:ss a' => Format::formatDate(time(), 'h:mm:ss a', $GLOBALS['language'] ?? 'en_US') . ' (' . _("Default") . ')', |
| 484 | + 'HH:mm:ss' => Format::formatDate(time(), 'HH:mm:ss', $GLOBALS['language'] ?? 'en_US') . ' (' . _("24-hour format") . ')', |
490 | 485 | ], |
491 | 486 | 'desc' => _("Choose how to display times (full format):"), |
492 | 487 | ]; |
493 | 488 |
|
494 | 489 | $_prefs['time_format_mini'] = [ |
495 | | - 'value' => '%X', |
| 490 | + 'value' => 'h:mm a', |
496 | 491 | 'type' => 'enum', |
497 | 492 | 'enum' => [ |
498 | | - '%X' => strftime('%X') . ' (' . _("Default") . ')', |
499 | | - '%H:%M' => strftime('%H:%M') . ' (' . _("24-hour format") . ')', |
500 | | - '%l:%M %p' => strftime('%l:%M %p'), |
| 493 | + 'h:mm a' => Format::formatDate(time(), 'h:mm a', $GLOBALS['language'] ?? 'en_US') . ' (' . _("Default") . ')', |
| 494 | + 'HH:mm' => Format::formatDate(time(), 'HH:mm', $GLOBALS['language'] ?? 'en_US') . ' (' . _("24-hour format") . ')', |
501 | 495 | ], |
502 | 496 | 'desc' => _("Choose how to display times (abbreviated format):"), |
503 | 497 | ]; |
|
0 commit comments