pike.git / lib / modules / Calendar.pmod / YMD.pmod

version» Context lines:

pike.git/lib/modules/Calendar.pmod/YMD.pmod:2516:      TimeofDay dwim_time(string what)   {    string a,h,m,s;    TimeofDay t;       foreach ( ({ " %z","%z",""}),    string zone )    foreach ( ({ "%t",    "%h:%*[ :]%m%*[ :]:%s", -  "%h:%*[ :]%m" }), +  "%h:%*[ :]%m", +  "T%t"}),    string todformat )    foreach ( ({ "%y-%M-%D (%*s) -W%W-%e (%e)",    "%D%*[ /]%M%*[- /,]%y",    "%M %D%*[- /,]%y",    "%e%*[ ]%D%*[ /]%M%*[-/ ,]%y",    "%y-%M-%D",    "%d",    "-%y%*[ /]%D%*[ /]%M",    "-%y%*[ /]%M%*[ /]%D",    "%y%*[ /]%D%*[ /]%M",    "%y%*[ /]%M%*[ /]%D",    "%D%*[- /]%M",    "%M%*[- /]%D",    "%e%*[- /wv]%W%*[ -/]%y", -  "%e%*[- /wv]%W" }), +  "%e%*[- /wv]%W", +  ""}),    string dayformat )    {    if ( (t=parse(dayformat+" "+todformat+zone,what)) ) return t;    if ( (t=parse(todformat+zone+" "+dayformat,what)) ) return t;    }       error("Failed to dwim time from %O\n",what);   }      //-- auxillary functions------------------------------------------------