LFT
  • Namespace
  • Class
  • Tree

Namespaces

  • Docoflow
    • Contracts
    • Entity
    • Facades
    • Models
    • Traits
  • Docolight
    • Agno
      • Traits
    • Container
    • Http
      • Contracts
    • Rest
      • Handler
      • Http
    • Support
      • Debug
      • Traits
  • Docotory
    • Traits
  • None

Classes

  • ActiveRecordWrapper
  • Arr
  • Carbonate
  • ClassLoader
  • Collection
  • CollectionDataProvider
  • Facade
  • Factory
  • Fluent
  • Html
  • IterablePager
  • Repository
  • Set
  • Str

Class Carbonate

Date helper.

Namespace: Docolight\Support
Author: Krisan Alfa Timur krisanalfa@docotel.co.id
Located at Docolight/Support/Carbonate.php

Methods summary

public static string|null
# formatId( string $date, string $format = 'Y-m-d H:i:s', string $returnFormat = 'D, d M Y' )

Format date to Indonesia Locale.

Format date to Indonesia Locale.

Parameters

$date
$format
$returnFormat

Returns

string|null
public static string
# formatLocale( Carbon\Carbon\Carbon $date, string $locale, string $returnFormat )

Format our locale date

Format our locale date

Parameters

$date
$locale
$returnFormat

Returns

string
public static integer|null
# monthIndex( Carbon\Carbon\Carbon $date )

Get month index. Useful for translation.

Get month index. Useful for translation.

Parameters

$date

Returns

integer|null
public static
# dayIndex( Carbon\Carbon\Carbon $date )
public static string|null
# localeMonth( Carbon\Carbon\Carbon $date, string $locale )

Get translated locale month

Get translated locale month

Parameters

$date
$locale

Returns

string|null
public static string|null
# localeDay( Carbon\Carbon\Carbon $date, string $locale )

Get translated locale day

Get translated locale day

Parameters

$date
$locale

Returns

string|null
public static array
# localeDays( $locale )

Get days name lists

Get days name lists

Returns

array
public static array
# localeMonths( $locale )

Get month name lists

Get month name lists

Returns

array
public static integer|null
# diff( string $start, string $end, string $format = 'Y-m-d' )

Return differ time in hours.

Return differ time in hours.

Parameters

$start
Date you want to start from.
$end
Date you want to calculate the difference from the start.
$format
The $start and $end format. They must be in the in same format.

Returns

integer|null

Properties summary

protected static array $month
# array( 'Jan' => 1, 'Feb' => 2, 'Mar' => 3, 'Apr' => 4, 'May' => 5, 'Jun' => 6, 'Jul' => 7, 'Aug' => 8, 'Sep' => 9, 'Oct' => 10, 'Nov' => 11, 'Dev' => 12, )
protected static array $day
# array( 'Mon' => 1, 'Tue' => 2, 'Wed' => 3, 'Thu' => 4, 'Fri' => 5, 'Sat' => 6, 'Sun' => 7, )
protected static array $localeMonth
# array( 'id' => array( 1 => 'Januari', 2 => 'Februari', 3 => 'Maret', 4 => 'April', 5 => 'Mei', 6 => 'Juni', 7 => 'Juli', 8 => 'Agustus', 9 => 'September', 10 => 'Oktober', 11 => 'November', 12 => 'Desember', ), )
protected static array $localeDays
# array( 'id' => array( 1 => 'Senin', 2 => 'Selasa', 3 => 'Rabu', 4 => 'Kamis', 5 => 'Jum\'at', 6 => 'Sabtu', 7 => 'Minggu', ), )
LFT API documentation generated by ApiGen