[Asterisk-code-review] say.conf: fix 12pm noon logic (asterisk[master])

Friendly Automation asteriskteam at digium.com
Wed Jan 5 14:17:22 CST 2022


Friendly Automation has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/17651 )

Change subject: say.conf: fix 12pm noon logic
......................................................................

say.conf: fix 12pm noon logic

Fixes 12pm noon incorrectly returning 0/a.m.
Also fixes a misspelling typo in the config.

ASTERISK-29695 #close

Change-Id: Ie40f9618636eb4c483b449bd707a5dcffca5c406
---
M configs/samples/say.conf.sample
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Friendly Automation: Approved for Submit



diff --git a/configs/samples/say.conf.sample b/configs/samples/say.conf.sample
index de35ee4..4cab590 100644
--- a/configs/samples/say.conf.sample
+++ b/configs/samples/say.conf.sample
@@ -90,17 +90,17 @@
     _date:[Aa]:. => digits/day-${SAY:16:1}	; day of week
     _date:[de]:. => num:${SAY:6:2}		; day of month
     _date:[H]:. => digits/oh, num:${SAY:8:2}			; hour (oh one, oh two, ..., oh nine, ten, eleven, ..., twenty-three)
-    _date:[I]:. => num:$[${SAY:8:2} % 12]	; hour 0-12
+    _date:[I]:. => num:${IF($[${SAY:8:2} > 12] ? $[${SAY:8:2}%12] : ${SAY:8:2})}	; hour 0-12
     _date:[M]:. => num:${SAY:10:2}		; minute
     ; XXX too bad the '?' function does not remove the quotes
-    ; _date:[pP]:. => digits/$[ ${SAY:10:2} > 12 ? "p-m" :: "a-m"]	; am pm
+    ; _date:[pP]:. => digits/$[ ${SAY:10:2} >= 12 ? "p-m" :: "a-m"]	; am pm
     _date:[pP]:. => digits/p-m	; am pm
     _date:[S]:. => num:${SAY:13:2}		; seconds
     _date:[Ii]:. => num:$[${SAY:8:2} % 12]			; hour 0-12
     _date:[k]:. => num:${SAY:8:2}				; hour (one, two. three, ...,twenty three
     _date:[m]:. => num:${SAY:4:2}				; month number
-    _date:[Q]:. => date:dby ;incompleat				; "today", "yesterday" or ABdY
-    _date:[q]:. => date:dby ;incompleat				; "" (for today), "yesterday", weekday, or ABdY
+    _date:[Q]:. => date:dby ;incomplete				; "today", "yesterday" or ABdY
+    _date:[q]:. => date:dby ;incomplete				; "" (for today), "yesterday", weekday, or ABdY
     _date:[R]:. => date:HM${SAY}				; 24 hour time, including minute
     _date:[T]:. => date:HMS${SAY}				; 24 hour, minure, seconds
 

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/17651
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Ie40f9618636eb4c483b449bd707a5dcffca5c406
Gerrit-Change-Number: 17651
Gerrit-PatchSet: 2
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-CC: Benjamin Keith Ford <bford at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20220105/5ee50ff7/attachment-0001.html>


More information about the asterisk-code-review mailing list