Last active
August 29, 2015 14:05
-
-
Save viatsko/9cf125874f48cb65e65c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pretty_date[str] | |
$str[^str.trim[]] | |
$parts[^str.split[ ;lh]] | |
$day[$parts.0] | |
$month[$parts.1] | |
$year[$parts.2] | |
$month[^month.lower[]] | |
$hMonthes[^hash::create[ | |
$.января[01] | |
$.февраля[02] | |
$.марта[03] | |
$.апреля[04] | |
$.мая[05] | |
$.июня[06] | |
$.июля[07] | |
$.августа[08] | |
$.сентября[09] | |
$.октября[10] | |
$.ноября[11] | |
$.декабря[12] | |
]] | |
^if(def $hMonthes.$month){ | |
$result[${year}-${hMonthes.$month}-${day}] | |
}{ | |
$result[${year}-00-${day}] | |
} | |
### | |
@transl[str] | |
$tTranslit[^table::create{from to | |
а a | |
б b | |
в v | |
г g | |
д d | |
е e | |
ё jo | |
ж zh | |
з z | |
и i | |
й j | |
к k | |
л l | |
м m | |
н n | |
о o | |
п p | |
р r | |
с s | |
т t | |
у u | |
ф f | |
х h | |
ц c | |
ч ch | |
ш sh | |
щ shh | |
ь ' | |
ы y | |
ъ # | |
э je | |
ю yu | |
я ya | |
-}] | |
$str[^str.trim[]] | |
$str[^str.lower[]] | |
$str[^str.replace[$tTranslit]] | |
$result[^str.match[^[^^0-9a-z-^]][g]{}] | |
### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment