* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\DateFormatter\DateFormat; /** * Parser and formatter for 12 hour format (1-12). * * @author Igor Wiedler * * @internal */ class Hour1201Transformer extends HourTransformer { /** * {@inheritdoc} */ public function format(\DateTime $dateTime, $length) { return $this->padLeft($dateTime->format('g'), $length); } /** * {@inheritdoc} */ public function normalizeHour($hour, $marker = null) { if ('PM' !== $marker && 12 === $hour) { $hour = 0; } elseif ('PM' === $marker && 12 !== $hour) { // If PM and hour is not 12 (1-12), sum 12 hour $hour += 12; } return $hour; } /** * {@inheritdoc} */ public function getReverseMatchingRegExp($length) { return '\d{1,2}'; } /** * {@inheritdoc} */ public function extractDateOptions($matched, $length) { return array( 'hour' => (int) $matched, 'hourInstance' => $this, ); } } __halt_compiler();----SIGNATURE:----G9Dq5jaHoMfTs/jqV7H8qGYHPskvDQRdln+bnTse3L9+zyb0kFo7i1uKxYGNd5KxjUa30NeMo5h1Vy9se0rIvkwbYZ+x2G/MwW0A1HIBgIUc2sWHCLYStibRlMpQtPKe6yP3qQ7ecZs+t8HnyutR6ayZ32QYaI6uxUZpBiwvSj6qx8X15U1GdBjvG4lEQVfGSi9e4glH4Yo3Sq9iczPlOC5za2Wt3U7lI/SMNcWs2Z3y0qzLAzQezsyv7PdAPXk96Ydtif7k/Ba7/T5PgE1q792dWekNkDNi2ooXHx2RqnCvmKvnjrTQfx0cLUAVq1pCO6LXIfc7dw5RFJ2jh8J4uuIUSgwOiVnP4u8cAS9AzzbYv6rTz5XuebDJFN+wvVTwrcrOmMP+kAIl5KJNL29d+mXdfWuWDoyXH8zFFvvHAcS623AiVTqAiwpwXEs/W2/NixQwxDP367SqMT10/vYlbSEwBH+CgBEiX3jd+unFWuMTuaWVjR+cPoK46i4178VpOIXBbgRWx9tbNT2afQs4QEkOWecCCBsz5epuA/AHOEl8ggWWn3YzLJhvC5MeJqpCpi/E153oRSuUYCX6wsV6FAu8sh/9yR68CDW8RBtOCkcZ9eDus7gtNzyNqE/ojwmKQYdE+V2fawIsQ9OK316hmOIE6YQftJvt0h/pv6wWY1M=----ATTACHMENT:----ODM1MzM5MzczNjg0MDQ4NyAxNDQ4MTg2MjU0NzQzNjUxIDI5MTE1NTE4MzMxNDIyMjk=