cleaning the house

This commit is contained in:
mynah
2020-01-20 14:49:59 -06:00
parent 252ec865b3
commit 7dfd107c04
81 changed files with 426 additions and 958 deletions

View File

@@ -2,7 +2,7 @@ package Dojo::Support;
use strict;
use warnings;
use Exporter 'import';
our @EXPORT = qw/ commify month_num2txt log dmph merge_hash load_module get_names /;
our @EXPORT = qw/ mtxt commify month_num2txt log dmph merge_hash load_module get_names /;
use Mojo::Base 'Mojolicious';
use File::Basename;
@@ -17,6 +17,7 @@ sub log{
my $log = Mojo::Log->new;
$log->debug("============ ".shift." ===========");
}
sub get_names{
my $dir = shift;
my @file_name;
@@ -36,13 +37,26 @@ sub merge_hash{
my $merger = Hash::Merge->new('LEFT_PRECEDENT');
foreach (@_){
$h= $merger->merge($h,$_);
}
return $h;
}
return $h;
}
sub month_num2txt{
return ("enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre" =~ m/\w+/g)[shift (@_) -1];
}
sub mtxt {
my ($di, $mi, $df, $mf)=@_; # dini,mini,dfin,mfin
my $txt;
if ($mi == $mf){
if ($di == $df){ $txt = "$di de ".month_num2txt($mi);}
else{ $txt = "Del $di al $df de ".month_num2txt($mi);}
}
else{
$txt = "Del $di de ".month_num2txt($mi)." al $df de ".month_num2txt($mf);
}
return $txt;
}
#put comas on price numbers
sub commify {