equal
deleted
inserted
replaced
313 * '0' before the numbers less than 10 for you. |
313 * '0' before the numbers less than 10 for you. |
314 * |
314 * |
315 * @since 2.1.0 |
315 * @since 2.1.0 |
316 * |
316 * |
317 * @param string|int $month_number '01' through '12'. |
317 * @param string|int $month_number '01' through '12'. |
318 * @return string Translated full month name. |
318 * @return string Translated full month name. If the month number is not found, an empty string is returned. |
319 */ |
319 */ |
320 public function get_month( $month_number ) { |
320 public function get_month( $month_number ) { |
321 return $this->month[ zeroise( $month_number, 2 ) ]; |
321 $month_number = zeroise( $month_number, 2 ); |
|
322 if ( ! isset( $this->month[ $month_number ] ) ) { |
|
323 return ''; |
|
324 } |
|
325 return $this->month[ $month_number ]; |
322 } |
326 } |
323 |
327 |
324 /** |
328 /** |
325 * Retrieves translated version of month abbreviation string. |
329 * Retrieves translated version of month abbreviation string. |
326 * |
330 * |
332 * @param string $month_name Translated month to get abbreviated version. |
336 * @param string $month_name Translated month to get abbreviated version. |
333 * @return string Translated abbreviated month. |
337 * @return string Translated abbreviated month. |
334 */ |
338 */ |
335 public function get_month_abbrev( $month_name ) { |
339 public function get_month_abbrev( $month_name ) { |
336 return $this->month_abbrev[ $month_name ]; |
340 return $this->month_abbrev[ $month_name ]; |
|
341 } |
|
342 |
|
343 /** |
|
344 * Retrieves translated version of month genitive string. |
|
345 * |
|
346 * The $month_number parameter has to be a string |
|
347 * because it must have the '0' in front of any number |
|
348 * that is less than 10. Starts from '01' and ends at |
|
349 * '12'. |
|
350 * |
|
351 * You can use an integer instead and it will add the |
|
352 * '0' before the numbers less than 10 for you. |
|
353 * |
|
354 * @since 6.8.0 |
|
355 * |
|
356 * @param string|int $month_number '01' through '12'. |
|
357 * @return string Translated genitive month name. |
|
358 */ |
|
359 public function get_month_genitive( $month_number ) { |
|
360 return $this->month_genitive[ zeroise( $month_number, 2 ) ]; |
337 } |
361 } |
338 |
362 |
339 /** |
363 /** |
340 * Retrieves translated version of meridiem string. |
364 * Retrieves translated version of meridiem string. |
341 * |
365 * |