shithub: werc

Download patch

ref: 528ffdd59f635817fc01499e403d079949ed960d
parent: b05ef130d682a29dca47351961cc3d3e533af097
author: sl <[email protected]>
date: Sat Dec 7 16:55:00 EST 2019

bin/werclib.rc: replace fn datei and fn datet (both broken) with fn ndate (implements 9front's date -i, -m, and -t)

--- a/bin/werclib.rc
+++ b/bin/werclib.rc
@@ -120,10 +120,8 @@
     }
 }
 
-fn datei { datet | sed 's/T.*$//' }
-
-fn datet {
-	date=`{read}
+fn ndate {
+	date=`{date}
 	switch($date(2)){
 	case Jan;	mo=01
 	case Feb;	mo=02
@@ -352,7 +350,14 @@
 	case YEKT;	tz=+0500
 	case Z;	tz=+0000
 	}
-	echo $date(6)^-$mo-$da^T^$date(4)^$tz
+	switch($1){
+	case -i
+		echo $date(6)^-$mo-$da
+	case -m
+		echo $date(1)^, $da $date(2) $date(6) $date(4) $tz
+	case -t
+		echo $date(6)^-$mo-$da^T^$date(4)^$tz
+	}
 }
 
 ##########################################################################