summaryrefslogtreecommitdiff
path: root/openid-selector
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2008-08-11 11:30:17 +0200
committerJonas Smedegaard <dr@jones.dk>2008-08-11 11:30:17 +0200
commitfe86ef498309f06b2418eaf131a1fd1ae15bd701 (patch)
tree5624afb8018187beb0bedf9ea83e43b399226c2f /openid-selector
parentfedca72d55ae521c29dee01725614b89140c202b (diff)
parent1055939846ed1e3c5da2f7cd4e8be5657c799c1a (diff)
Merge branch 'nonedit' into allinone-da
Conflicts (manually resolved): ikiwiki_da.setup
Diffstat (limited to 'openid-selector')
0 files changed, 0 insertions, 0 deletions
_auto => 1,
  • _decode => 1,
  • });
  • sub text {
  • my ($self, $text, @params) = @_;
  • return encode_entities($self->maketext($text, @params));
  • }
  • ##sub date {
  • ## my ($self, $myconfig, $date, $longformat) = @_;
  • ## return $date;
  • ##}
  • sub date {
  • my ($self, $myconfig, $date, $longformat) = @_;
  • my @longmonth = (qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec));
  • @longmonth = ("January", "February", "March", "April", "May ", "June",
  • "July", "August", "September", "October", "November",
  • "December") if $longformat;
  • my $longdate = '';
  • return '' if not $date;
  • my $spc = '';
  • my $yy = '';
  • my $mm = '';
  • my $dd = '';
  • # get separator
  • $spc = $myconfig->{dateformat};
  • $spc =~ s/\w//g;
  • $spc = substr($spc, 0, 1);
  • if (!$longformat && $date =~ /^\d{4}\D/){ # reparsing date at this point
  • # causes problems!
  • return $date;
  • }
  • if ($date =~ /\D/) {
  • if ($myconfig->{dateformat} =~ /^yy/) {
  • ($yy, $mm, $dd) = split /\D/, $date;
  • }
  • if ($myconfig->{dateformat} =~ /^mm/) {
  • ($mm, $dd, $yy) = split /\D/, $date;
  • }
  • if ($myconfig->{dateformat} =~ /^dd/) {
  • ($dd, $mm, $yy) = split /\D/, $date;
  • }
  • } else {
  • $date = substr($date, 2);
  • ($yy, $mm, $dd) = ($date =~ /(..)(..)(..)/);
  • }
  • $dd *= 1;
  • $mm--;
  • $yy += 2000 if length $yy == 2;
  • if ($myconfig->{dateformat} =~ /^dd/) {
  • $mm++;
  • $dd = substr("0$dd", -2);
  • $mm = substr("0$mm", -2);
  • $longdate = "$dd$spc$mm$spc$yy";
  • if (defined $longformat) {
  • $longdate = "$dd";
  • $longdate .= ($spc eq '.') ? ". " : " ";
  • $longdate .= &text($self, $longmonth[--$mm])." $yy";
  • }
  • } elsif ($myconfig->{dateformat} =~ /^yy/) {
  • $mm++;
  • $dd = substr("0$dd", -2);
  • $mm = substr("0$mm", -2);
  • $longdate = "$yy$spc$mm$spc$dd";
  • } else {
  • $mm++;
  • $dd = substr("0$dd", -2);