Version Description
- 2017-02-14 =
- Fixed: subscriber stats for lists are accurately calculated;
- Fixed: 'Create a new form' link in the MailPoet Form widget now leads to the Form editor;
- Fixed: category names are shown for Automated latest content widget posts on WP 4.7. Thanks Christopher!;
- Fixed: SendGrid error messages are properly displayed. Thanks Larry!;
- Fixed: non-Latin-1 characters are now rendered on some hosts running PHP 5.3. Thanks Andreas!
Download this release
Release Info
Developer | wysija |
Plugin | MailPoet Newsletters (New) |
Version | 3.0.0-beta.18 |
Comparing to | |
See all releases |
Code changes from version 3.0.0-beta.17 to 3.0.0-beta.18
- lang/mailpoet.pot +6 -6
- lib/Form/Widget.php +2 -2
- lib/Mailer/Methods/SendGrid.php +2 -2
- lib/Models/Segment.php +9 -4
- lib/Newsletter/Editor/MetaInformationManager.php +1 -1
- lib/Newsletter/Renderer/Blocks/Footer.php +2 -1
- lib/Newsletter/Renderer/Blocks/Header.php +2 -1
- lib/Newsletter/Renderer/Blocks/Text.php +5 -4
- lib/Newsletter/Renderer/PostProcess/OpenTracking.php +2 -1
- lib/Newsletter/Renderer/Renderer.php +3 -1
- lib/Util/pQuery/index.php +0 -0
- lib/Util/pQuery/pQuery.php +27 -0
- mailpoet.php +2 -2
- readme.txt +8 -1
- vendor/autoload.php +1 -1
- vendor/composer/autoload_classmap.php +4 -0
- vendor/composer/autoload_namespaces.php +0 -1
- vendor/composer/autoload_psr4.php +1 -0
- vendor/composer/autoload_real.php +7 -7
- vendor/composer/autoload_static.php +14 -12
- vendor/composer/installed.json +28 -22
- vendor/mtdowling/cron-expression/composer.json +7 -2
- vendor/mtdowling/cron-expression/src/Cron/AbstractField.php +7 -2
- vendor/mtdowling/cron-expression/src/Cron/CronExpression.php +26 -19
- vendor/mtdowling/cron-expression/src/Cron/DayOfMonthField.php +74 -4
- vendor/mtdowling/cron-expression/src/Cron/DayOfWeekField.php +9 -5
- vendor/mtdowling/cron-expression/src/Cron/FieldFactory.php +3 -1
- vendor/mtdowling/cron-expression/src/Cron/FieldInterface.php +3 -2
- vendor/mtdowling/cron-expression/src/Cron/HoursField.php +6 -3
- vendor/mtdowling/cron-expression/src/Cron/MinutesField.php +5 -2
- vendor/mtdowling/cron-expression/src/Cron/YearField.php +5 -2
- vendor/nesbot/carbon/.php_cs.dist +57 -0
- vendor/nesbot/carbon/composer.json +51 -37
- vendor/nesbot/carbon/src/Carbon/Carbon.php +1015 -268
- vendor/nesbot/carbon/src/Carbon/CarbonInterval.php +55 -21
- vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php +67 -0
- vendor/nesbot/carbon/src/Carbon/Exceptions/index.php +0 -0
- vendor/nesbot/carbon/src/Carbon/Lang/af.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/ar.php +18 -18
- vendor/nesbot/carbon/src/Carbon/Lang/az.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/bg.php +18 -18
- vendor/nesbot/carbon/src/Carbon/Lang/bn.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/ca.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/cs.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/da.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/de.php +21 -19
- vendor/nesbot/carbon/src/Carbon/Lang/el.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/en.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/eo.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/es.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/et.php +20 -12
- vendor/nesbot/carbon/src/Carbon/Lang/eu.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/fa.php +18 -16
- vendor/nesbot/carbon/src/Carbon/Lang/fi.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/fo.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/fr.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/gl.php +24 -0
- vendor/nesbot/carbon/src/Carbon/Lang/he.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/hr.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/hu.php +41 -18
- vendor/nesbot/carbon/src/Carbon/Lang/hy.php +31 -0
- vendor/nesbot/carbon/src/Carbon/Lang/id.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/it.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/ja.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/ka.php +31 -0
- vendor/nesbot/carbon/src/Carbon/Lang/km.php +31 -0
- vendor/nesbot/carbon/src/Carbon/Lang/ko.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/lt.php +25 -16
- vendor/nesbot/carbon/src/Carbon/Lang/lv.php +32 -28
- vendor/nesbot/carbon/src/Carbon/Lang/mk.php +24 -0
- vendor/nesbot/carbon/src/Carbon/Lang/ms.php +20 -15
- vendor/nesbot/carbon/src/Carbon/Lang/nl.php +20 -15
- vendor/nesbot/carbon/src/Carbon/Lang/no.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/pl.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/pt.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php +20 -15
- vendor/nesbot/carbon/src/Carbon/Lang/ro.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/ru.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/sk.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/sl.php +26 -24
- vendor/nesbot/carbon/src/Carbon/Lang/sq.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/sr.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php +38 -0
- vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php +38 -0
- vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php +38 -0
- vendor/nesbot/carbon/src/Carbon/Lang/sv.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/th.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/tr.php +18 -15
- vendor/nesbot/carbon/src/Carbon/Lang/uk.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/ur.php +24 -0
- vendor/nesbot/carbon/src/Carbon/Lang/uz.php +19 -15
- vendor/nesbot/carbon/src/Carbon/Lang/vi.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/zh-TW.php +0 -29
- vendor/nesbot/carbon/src/Carbon/Lang/zh.php +20 -18
- vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php +31 -0
- vendor/symfony/translation/Util/ArrayConverter.php +1 -1
- views/settings/mta.html +1 -1
lang/mailpoet.pot
CHANGED
@@ -4,7 +4,7 @@ msgid ""
|
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: \n"
|
6 |
"Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
|
7 |
-
"POT-Creation-Date: 2017-02-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -1210,12 +1210,12 @@ msgid "Please specify a type."
|
|
1210 |
msgstr ""
|
1211 |
|
1212 |
#: lib/Models/Form.php:93 lib/Models/Newsletter.php:464
|
1213 |
-
#: lib/Models/Segment.php:
|
1214 |
msgid "All"
|
1215 |
msgstr ""
|
1216 |
|
1217 |
#: lib/Models/Form.php:98 lib/Models/Newsletter.php:534
|
1218 |
-
#: lib/Models/Segment.php:
|
1219 |
#: views/newsletters.html:75 views/segments.html:50
|
1220 |
#: views/subscribers/subscribers.html:34
|
1221 |
msgid "Trash"
|
@@ -1268,15 +1268,15 @@ msgstr ""
|
|
1268 |
msgid "The template body cannot be empty."
|
1269 |
msgstr ""
|
1270 |
|
1271 |
-
#: lib/Models/Segment.php:
|
1272 |
msgid "WordPress Users"
|
1273 |
msgstr ""
|
1274 |
|
1275 |
-
#: lib/Models/Segment.php:
|
1276 |
msgid "This list contains all of your WordPress users."
|
1277 |
msgstr ""
|
1278 |
|
1279 |
-
#: lib/Models/Segment.php:
|
1280 |
msgid "Not in a List"
|
1281 |
msgstr ""
|
1282 |
|
4 |
msgstr ""
|
5 |
"Project-Id-Version: \n"
|
6 |
"Report-Msgid-Bugs-To: http://support.mailpoet.com/\n"
|
7 |
+
"POT-Creation-Date: 2017-02-14 14:28:46+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
1210 |
msgstr ""
|
1211 |
|
1212 |
#: lib/Models/Form.php:93 lib/Models/Newsletter.php:464
|
1213 |
+
#: lib/Models/Segment.php:131 lib/Models/Subscriber.php:343
|
1214 |
msgid "All"
|
1215 |
msgstr ""
|
1216 |
|
1217 |
#: lib/Models/Form.php:98 lib/Models/Newsletter.php:534
|
1218 |
+
#: lib/Models/Segment.php:136 lib/Models/Subscriber.php:368 views/forms.html:56
|
1219 |
#: views/newsletters.html:75 views/segments.html:50
|
1220 |
#: views/subscribers/subscribers.html:34
|
1221 |
msgid "Trash"
|
1268 |
msgid "The template body cannot be empty."
|
1269 |
msgstr ""
|
1270 |
|
1271 |
+
#: lib/Models/Segment.php:112 views/subscribers/subscribers.html:82
|
1272 |
msgid "WordPress Users"
|
1273 |
msgstr ""
|
1274 |
|
1275 |
+
#: lib/Models/Segment.php:114
|
1276 |
msgid "This list contains all of your WordPress users."
|
1277 |
msgstr ""
|
1278 |
|
1279 |
+
#: lib/Models/Segment.php:198
|
1280 |
msgid "Not in a List"
|
1281 |
msgstr ""
|
1282 |
|
lib/Form/Widget.php
CHANGED
@@ -79,9 +79,9 @@ class Widget extends \WP_Widget {
|
|
79 |
endpoint: 'forms',
|
80 |
action: 'create'
|
81 |
}).done(function(response) {
|
82 |
-
if(response.
|
83 |
window.location =
|
84 |
-
"<?php echo $form_edit_url; ?>" + response.
|
85 |
}
|
86 |
});
|
87 |
return false;
|
79 |
endpoint: 'forms',
|
80 |
action: 'create'
|
81 |
}).done(function(response) {
|
82 |
+
if(response.data && response.data.id) {
|
83 |
window.location =
|
84 |
+
"<?php echo $form_edit_url; ?>" + response.data.id;
|
85 |
}
|
86 |
});
|
87 |
return false;
|
lib/Mailer/Methods/SendGrid.php
CHANGED
@@ -27,8 +27,8 @@ class SendGrid {
|
|
27 |
}
|
28 |
if(wp_remote_retrieve_response_code($result) !== 200) {
|
29 |
$response = json_decode($result['body'], true);
|
30 |
-
$response = (!empty($response['errors'])) ?
|
31 |
-
$response['errors'] :
|
32 |
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID);
|
33 |
return Mailer::formatMailerSendErrorResult($response);
|
34 |
}
|
27 |
}
|
28 |
if(wp_remote_retrieve_response_code($result) !== 200) {
|
29 |
$response = json_decode($result['body'], true);
|
30 |
+
$response = (!empty($response['errors'][0])) ?
|
31 |
+
$response['errors'][0] :
|
32 |
sprintf(__('%s has returned an unknown error.', 'mailpoet'), Mailer::METHOD_SENDGRID);
|
33 |
return Mailer::formatMailerSendErrorResult($response);
|
34 |
}
|
lib/Models/Segment.php
CHANGED
@@ -76,21 +76,26 @@ class Segment extends Model {
|
|
76 |
'subscribers'
|
77 |
)
|
78 |
->select_expr(
|
79 |
-
'SUM(CASE subscribers.status
|
|
|
80 |
Subscriber::STATUS_SUBSCRIBED
|
81 |
)
|
82 |
->select_expr(
|
83 |
-
'SUM(CASE subscribers.status
|
|
|
84 |
Subscriber::STATUS_UNSUBSCRIBED
|
85 |
)
|
86 |
->select_expr(
|
87 |
-
'SUM(CASE subscribers.status
|
|
|
88 |
Subscriber::STATUS_UNCONFIRMED
|
89 |
)
|
90 |
->select_expr(
|
91 |
-
'SUM(CASE subscribers.status
|
|
|
92 |
Subscriber::STATUS_BOUNCED
|
93 |
)
|
|
|
94 |
->findOne()
|
95 |
->asArray();
|
96 |
|
76 |
'subscribers'
|
77 |
)
|
78 |
->select_expr(
|
79 |
+
'SUM(CASE WHEN subscribers.status = "' . Subscriber::STATUS_SUBSCRIBED . '"
|
80 |
+
AND relation.status = "' . Subscriber::STATUS_SUBSCRIBED . '" THEN 1 ELSE 0 END)',
|
81 |
Subscriber::STATUS_SUBSCRIBED
|
82 |
)
|
83 |
->select_expr(
|
84 |
+
'SUM(CASE WHEN subscribers.status = "' . Subscriber::STATUS_UNSUBSCRIBED . '"
|
85 |
+
OR relation.status = "' . Subscriber::STATUS_UNSUBSCRIBED . '" THEN 1 ELSE 0 END)',
|
86 |
Subscriber::STATUS_UNSUBSCRIBED
|
87 |
)
|
88 |
->select_expr(
|
89 |
+
'SUM(CASE WHEN subscribers.status = "' . Subscriber::STATUS_UNCONFIRMED . '"
|
90 |
+
AND relation.status != "' . Subscriber::STATUS_UNSUBSCRIBED . '" THEN 1 ELSE 0 END)',
|
91 |
Subscriber::STATUS_UNCONFIRMED
|
92 |
)
|
93 |
->select_expr(
|
94 |
+
'SUM(CASE WHEN subscribers.status = "' . Subscriber::STATUS_BOUNCED . '"
|
95 |
+
AND relation.status != "' . Subscriber::STATUS_UNSUBSCRIBED . '" THEN 1 ELSE 0 END)',
|
96 |
Subscriber::STATUS_BOUNCED
|
97 |
)
|
98 |
+
->whereNull('subscribers.deleted_at')
|
99 |
->findOne()
|
100 |
->asArray();
|
101 |
|
lib/Newsletter/Editor/MetaInformationManager.php
CHANGED
@@ -43,7 +43,7 @@ class MetaInformationManager {
|
|
43 |
// Get categories
|
44 |
$categories = wp_get_post_terms(
|
45 |
$post_id,
|
46 |
-
|
47 |
array('fields' => 'names')
|
48 |
);
|
49 |
if(!empty($categories)) {
|
43 |
// Get categories
|
44 |
$categories = wp_get_post_terms(
|
45 |
$post_id,
|
46 |
+
array('post_tag', 'category'),
|
47 |
array('fields' => 'names')
|
48 |
);
|
49 |
if(!empty($categories)) {
|
lib/Newsletter/Renderer/Blocks/Footer.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
namespace MailPoet\Newsletter\Renderer\Blocks;
|
3 |
|
4 |
use MailPoet\Newsletter\Renderer\StylesHelper;
|
|
|
5 |
|
6 |
class Footer {
|
7 |
static function render($element) {
|
@@ -10,7 +11,7 @@ class Footer {
|
|
10 |
$line_height = sprintf(
|
11 |
'%spx', StylesHelper::$line_height_multiplier * (int)$element['styles']['text']['fontSize']
|
12 |
);
|
13 |
-
$DOM_parser = new
|
14 |
$DOM = $DOM_parser->parseStr($element['text']);
|
15 |
if(isset($element['styles']['link'])) {
|
16 |
$links = $DOM->query('a');
|
2 |
namespace MailPoet\Newsletter\Renderer\Blocks;
|
3 |
|
4 |
use MailPoet\Newsletter\Renderer\StylesHelper;
|
5 |
+
use MailPoet\Util\pQuery\pQuery;
|
6 |
|
7 |
class Footer {
|
8 |
static function render($element) {
|
11 |
$line_height = sprintf(
|
12 |
'%spx', StylesHelper::$line_height_multiplier * (int)$element['styles']['text']['fontSize']
|
13 |
);
|
14 |
+
$DOM_parser = new pQuery();
|
15 |
$DOM = $DOM_parser->parseStr($element['text']);
|
16 |
if(isset($element['styles']['link'])) {
|
17 |
$links = $DOM->query('a');
|
lib/Newsletter/Renderer/Blocks/Header.php
CHANGED
@@ -2,6 +2,7 @@
|
|
2 |
namespace MailPoet\Newsletter\Renderer\Blocks;
|
3 |
|
4 |
use MailPoet\Newsletter\Renderer\StylesHelper;
|
|
|
5 |
|
6 |
class Header {
|
7 |
static function render($element) {
|
@@ -10,7 +11,7 @@ class Header {
|
|
10 |
$line_height = sprintf(
|
11 |
'%spx', StylesHelper::$line_height_multiplier * (int)$element['styles']['text']['fontSize']
|
12 |
);
|
13 |
-
$DOM_parser = new
|
14 |
$DOM = $DOM_parser->parseStr($element['text']);
|
15 |
if(isset($element['styles']['link'])) {
|
16 |
$links = $DOM->query('a');
|
2 |
namespace MailPoet\Newsletter\Renderer\Blocks;
|
3 |
|
4 |
use MailPoet\Newsletter\Renderer\StylesHelper;
|
5 |
+
use MailPoet\Util\pQuery\pQuery;
|
6 |
|
7 |
class Header {
|
8 |
static function render($element) {
|
11 |
$line_height = sprintf(
|
12 |
'%spx', StylesHelper::$line_height_multiplier * (int)$element['styles']['text']['fontSize']
|
13 |
);
|
14 |
+
$DOM_parser = new pQuery();
|
15 |
$DOM = $DOM_parser->parseStr($element['text']);
|
16 |
if(isset($element['styles']['link'])) {
|
17 |
$links = $DOM->query('a');
|
lib/Newsletter/Renderer/Blocks/Text.php
CHANGED
@@ -3,6 +3,7 @@ namespace MailPoet\Newsletter\Renderer\Blocks;
|
|
3 |
|
4 |
use MailPoet\Newsletter\Editor\PostContentManager;
|
5 |
use MailPoet\Newsletter\Renderer\StylesHelper;
|
|
|
6 |
|
7 |
class Text {
|
8 |
static function render($element) {
|
@@ -25,7 +26,7 @@ class Text {
|
|
25 |
}
|
26 |
|
27 |
static function convertBlockquotesToTables($html) {
|
28 |
-
$DOM_parser = new
|
29 |
$DOM = $DOM_parser->parseStr($html);
|
30 |
$blockquotes = $DOM->query('blockquote');
|
31 |
foreach($blockquotes as $blockquote) {
|
@@ -70,7 +71,7 @@ class Text {
|
|
70 |
}
|
71 |
|
72 |
static function convertParagraphsToTables($html) {
|
73 |
-
$DOM_parser = new
|
74 |
$DOM = $DOM_parser->parseStr($html);
|
75 |
$paragraphs = $DOM->query('p');
|
76 |
if(!$paragraphs->count()) return $html;
|
@@ -134,7 +135,7 @@ class Text {
|
|
134 |
}
|
135 |
|
136 |
static function styleLists($html) {
|
137 |
-
$DOM_parser = new
|
138 |
$DOM = $DOM_parser->parseStr($html);
|
139 |
$lists = $DOM->query('ol, ul, li');
|
140 |
if(!$lists->count()) return $html;
|
@@ -153,7 +154,7 @@ class Text {
|
|
153 |
}
|
154 |
|
155 |
static function styleHeadings($html) {
|
156 |
-
$DOM_parser = new
|
157 |
$DOM = $DOM_parser->parseStr($html);
|
158 |
$headings = $DOM->query('h1, h2, h3, h4');
|
159 |
if(!$headings->count()) return $html;
|
3 |
|
4 |
use MailPoet\Newsletter\Editor\PostContentManager;
|
5 |
use MailPoet\Newsletter\Renderer\StylesHelper;
|
6 |
+
use MailPoet\Util\pQuery\pQuery;
|
7 |
|
8 |
class Text {
|
9 |
static function render($element) {
|
26 |
}
|
27 |
|
28 |
static function convertBlockquotesToTables($html) {
|
29 |
+
$DOM_parser = new pQuery();
|
30 |
$DOM = $DOM_parser->parseStr($html);
|
31 |
$blockquotes = $DOM->query('blockquote');
|
32 |
foreach($blockquotes as $blockquote) {
|
71 |
}
|
72 |
|
73 |
static function convertParagraphsToTables($html) {
|
74 |
+
$DOM_parser = new pQuery();
|
75 |
$DOM = $DOM_parser->parseStr($html);
|
76 |
$paragraphs = $DOM->query('p');
|
77 |
if(!$paragraphs->count()) return $html;
|
135 |
}
|
136 |
|
137 |
static function styleLists($html) {
|
138 |
+
$DOM_parser = new pQuery();
|
139 |
$DOM = $DOM_parser->parseStr($html);
|
140 |
$lists = $DOM->query('ol, ul, li');
|
141 |
if(!$lists->count()) return $html;
|
154 |
}
|
155 |
|
156 |
static function styleHeadings($html) {
|
157 |
+
$DOM_parser = new pQuery();
|
158 |
$DOM = $DOM_parser->parseStr($html);
|
159 |
$headings = $DOM->query('h1, h2, h3, h4');
|
160 |
if(!$headings->count()) return $html;
|
lib/Newsletter/Renderer/PostProcess/OpenTracking.php
CHANGED
@@ -3,10 +3,11 @@ namespace MailPoet\Newsletter\Renderer\PostProcess;
|
|
3 |
|
4 |
use MailPoet\Newsletter\Links\Links;
|
5 |
use MailPoet\Newsletter\Renderer\Renderer;
|
|
|
6 |
|
7 |
class OpenTracking {
|
8 |
static function process($template) {
|
9 |
-
$DOM = new
|
10 |
$DOM = $DOM->parseStr($template);
|
11 |
$template = $DOM->query('body');
|
12 |
// url is a temporary data tag that will be further replaced with
|
3 |
|
4 |
use MailPoet\Newsletter\Links\Links;
|
5 |
use MailPoet\Newsletter\Renderer\Renderer;
|
6 |
+
use MailPoet\Util\pQuery\pQuery;
|
7 |
|
8 |
class OpenTracking {
|
9 |
static function process($template) {
|
10 |
+
$DOM = new pQuery();
|
11 |
$DOM = $DOM->parseStr($template);
|
12 |
$template = $DOM->query('body');
|
13 |
// url is a temporary data tag that will be further replaced with
|
lib/Newsletter/Renderer/Renderer.php
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
<?php
|
2 |
namespace MailPoet\Newsletter\Renderer;
|
3 |
|
|
|
|
|
4 |
if(!defined('ABSPATH')) exit;
|
5 |
|
6 |
class Renderer {
|
@@ -19,7 +21,7 @@ class Renderer {
|
|
19 |
$this->preview = $preview;
|
20 |
$this->blocks_renderer = new Blocks\Renderer($this->newsletter, $this->preview);
|
21 |
$this->columns_renderer = new Columns\Renderer();
|
22 |
-
$this->DOM_parser = new
|
23 |
$this->CSS_inliner = new \MailPoet\Util\CSS();
|
24 |
$this->template = file_get_contents(dirname(__FILE__) . '/' . self::NEWSLETTER_TEMPLATE);
|
25 |
}
|
1 |
<?php
|
2 |
namespace MailPoet\Newsletter\Renderer;
|
3 |
|
4 |
+
use MailPoet\Util\pQuery\pQuery;
|
5 |
+
|
6 |
if(!defined('ABSPATH')) exit;
|
7 |
|
8 |
class Renderer {
|
21 |
$this->preview = $preview;
|
22 |
$this->blocks_renderer = new Blocks\Renderer($this->newsletter, $this->preview);
|
23 |
$this->columns_renderer = new Columns\Renderer();
|
24 |
+
$this->DOM_parser = new pQuery();
|
25 |
$this->CSS_inliner = new \MailPoet\Util\CSS();
|
26 |
$this->template = file_get_contents(dirname(__FILE__) . '/' . self::NEWSLETTER_TEMPLATE);
|
27 |
}
|
lib/Util/pQuery/index.php
ADDED
File without changes
|
lib/Util/pQuery/pQuery.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace MailPoet\Util\pQuery;
|
4 |
+
|
5 |
+
// extend pQuery class to use UTF-8 encoding when getting elements' inner/outer text
|
6 |
+
class pQuery extends \pQuery {
|
7 |
+
public static function parseStr($html) {
|
8 |
+
$parser = new Html5Parser($html);
|
9 |
+
return $parser->root;
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
class Html5Parser extends \pQuery\HtmlParser {
|
14 |
+
var $root = 'MailPoet\Util\pQuery\DomNode';
|
15 |
+
}
|
16 |
+
|
17 |
+
class DomNode extends \pQuery\DomNode {
|
18 |
+
var $childClass = 'MailPoet\Util\pQuery\DomNode';
|
19 |
+
|
20 |
+
function getInnerText() {
|
21 |
+
return html_entity_decode($this->toString(true, true, 1), ENT_QUOTES, 'UTF-8');
|
22 |
+
}
|
23 |
+
|
24 |
+
function getOuterText() {
|
25 |
+
return html_entity_decode($this->toString(), ENT_QUOTES, 'UTF-8');
|
26 |
+
}
|
27 |
+
}
|
mailpoet.php
CHANGED
@@ -4,7 +4,7 @@ if(!defined('ABSPATH')) exit;
|
|
4 |
|
5 |
/*
|
6 |
* Plugin Name: MailPoet
|
7 |
-
* Version: 3.0.0-beta.
|
8 |
* Plugin URI: http://www.mailpoet.com
|
9 |
* Description: Create and send beautiful email newsletters, autoresponders, and post notifications without leaving WordPress. This is a beta version of our brand new plugin!
|
10 |
* Author: MailPoet
|
@@ -21,7 +21,7 @@ if(!defined('ABSPATH')) exit;
|
|
21 |
*/
|
22 |
|
23 |
$mailpoet_plugin = array(
|
24 |
-
'version' => '3.0.0-beta.
|
25 |
'filename' => __FILE__,
|
26 |
'path' => dirname(__FILE__),
|
27 |
'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
|
4 |
|
5 |
/*
|
6 |
* Plugin Name: MailPoet
|
7 |
+
* Version: 3.0.0-beta.18
|
8 |
* Plugin URI: http://www.mailpoet.com
|
9 |
* Description: Create and send beautiful email newsletters, autoresponders, and post notifications without leaving WordPress. This is a beta version of our brand new plugin!
|
10 |
* Author: MailPoet
|
21 |
*/
|
22 |
|
23 |
$mailpoet_plugin = array(
|
24 |
+
'version' => '3.0.0-beta.18',
|
25 |
'filename' => __FILE__,
|
26 |
'path' => dirname(__FILE__),
|
27 |
'autoloader' => dirname(__FILE__) . '/vendor/autoload.php',
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: mailpoet, wysija
|
|
3 |
Tags: newsletter, email, welcome email, post notification, autoresponder, signup, smtp
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 4.7.2
|
6 |
-
Stable tag: 3.0.0-beta.
|
7 |
Create and send beautiful emails and newsletters from WordPress.
|
8 |
|
9 |
== Description ==
|
@@ -83,6 +83,13 @@ Our [support site](https://docs.mailpoet.com/) has plenty of articles. You can w
|
|
83 |
|
84 |
== Changelog ==
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
= 3.0.0-beta.17 - 2017-02-01 =
|
87 |
* Added: send in style with MailPoet's own sending service. Visit your MailPoet Settings > Send with... tab.
|
88 |
|
3 |
Tags: newsletter, email, welcome email, post notification, autoresponder, signup, smtp
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 4.7.2
|
6 |
+
Stable tag: 3.0.0-beta.18
|
7 |
Create and send beautiful emails and newsletters from WordPress.
|
8 |
|
9 |
== Description ==
|
83 |
|
84 |
== Changelog ==
|
85 |
|
86 |
+
= 3.0.0-beta.18 - 2017-02-14 =
|
87 |
+
* Fixed: subscriber stats for lists are accurately calculated;
|
88 |
+
* Fixed: 'Create a new form' link in the MailPoet Form widget now leads to the Form editor;
|
89 |
+
* Fixed: category names are shown for Automated latest content widget posts on WP 4.7. Thanks Christopher!;
|
90 |
+
* Fixed: SendGrid error messages are properly displayed. Thanks Larry!;
|
91 |
+
* Fixed: non-Latin-1 characters are now rendered on some hosts running PHP 5.3. Thanks Andreas!
|
92 |
+
|
93 |
= 3.0.0-beta.17 - 2017-02-01 =
|
94 |
* Added: send in style with MailPoet's own sending service. Visit your MailPoet Settings > Send with... tab.
|
95 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit5331c916d5c60c1cf869dcbb6cd2c0be::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -8,6 +8,7 @@ $baseDir = dirname($vendorDir);
|
|
8 |
return array(
|
9 |
'Carbon\\Carbon' => $vendorDir . '/nesbot/carbon/src/Carbon/Carbon.php',
|
10 |
'Carbon\\CarbonInterval' => $vendorDir . '/nesbot/carbon/src/Carbon/CarbonInterval.php',
|
|
|
11 |
'Cron\\AbstractField' => $vendorDir . '/mtdowling/cron-expression/src/Cron/AbstractField.php',
|
12 |
'Cron\\CronExpression' => $vendorDir . '/mtdowling/cron-expression/src/Cron/CronExpression.php',
|
13 |
'Cron\\DayOfMonthField' => $vendorDir . '/mtdowling/cron-expression/src/Cron/DayOfMonthField.php',
|
@@ -204,6 +205,9 @@ return array(
|
|
204 |
'MailPoet\\Util\\Url' => $baseDir . '/lib/Util/Url.php',
|
205 |
'MailPoet\\Util\\XLSXWriter' => $baseDir . '/lib/Util/XLSXWriter.php',
|
206 |
'MailPoet\\Util\\XLSXWriter_BuffererWriter' => $baseDir . '/lib/Util/XLSXWriter.php',
|
|
|
|
|
|
|
207 |
'MailPoet\\WP\\DateTime' => $baseDir . '/lib/WP/DateTime.php',
|
208 |
'MailPoet\\WP\\Notice' => $baseDir . '/lib/WP/Notice.php',
|
209 |
'MailPoet\\WP\\Readme' => $baseDir . '/lib/WP/Readme.php',
|
8 |
return array(
|
9 |
'Carbon\\Carbon' => $vendorDir . '/nesbot/carbon/src/Carbon/Carbon.php',
|
10 |
'Carbon\\CarbonInterval' => $vendorDir . '/nesbot/carbon/src/Carbon/CarbonInterval.php',
|
11 |
+
'Carbon\\Exceptions\\InvalidDateException' => $vendorDir . '/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php',
|
12 |
'Cron\\AbstractField' => $vendorDir . '/mtdowling/cron-expression/src/Cron/AbstractField.php',
|
13 |
'Cron\\CronExpression' => $vendorDir . '/mtdowling/cron-expression/src/Cron/CronExpression.php',
|
14 |
'Cron\\DayOfMonthField' => $vendorDir . '/mtdowling/cron-expression/src/Cron/DayOfMonthField.php',
|
205 |
'MailPoet\\Util\\Url' => $baseDir . '/lib/Util/Url.php',
|
206 |
'MailPoet\\Util\\XLSXWriter' => $baseDir . '/lib/Util/XLSXWriter.php',
|
207 |
'MailPoet\\Util\\XLSXWriter_BuffererWriter' => $baseDir . '/lib/Util/XLSXWriter.php',
|
208 |
+
'MailPoet\\Util\\pQuery\\DomNode' => $baseDir . '/lib/Util/pQuery/pQuery.php',
|
209 |
+
'MailPoet\\Util\\pQuery\\Html5Parser' => $baseDir . '/lib/Util/pQuery/pQuery.php',
|
210 |
+
'MailPoet\\Util\\pQuery\\pQuery' => $baseDir . '/lib/Util/pQuery/pQuery.php',
|
211 |
'MailPoet\\WP\\DateTime' => $baseDir . '/lib/WP/DateTime.php',
|
212 |
'MailPoet\\WP\\Notice' => $baseDir . '/lib/WP/Notice.php',
|
213 |
'MailPoet\\WP\\Readme' => $baseDir . '/lib/WP/Readme.php',
|
vendor/composer/autoload_namespaces.php
CHANGED
@@ -8,5 +8,4 @@ $baseDir = dirname($vendorDir);
|
|
8 |
return array(
|
9 |
'Twig_' => array($vendorDir . '/twig/twig/lib'),
|
10 |
'Sabberworm\\CSS' => array($vendorDir . '/sabberworm/php-css-parser/lib'),
|
11 |
-
'Cron' => array($vendorDir . '/mtdowling/cron-expression/src'),
|
12 |
);
|
8 |
return array(
|
9 |
'Twig_' => array($vendorDir . '/twig/twig/lib'),
|
10 |
'Sabberworm\\CSS' => array($vendorDir . '/sabberworm/php-css-parser/lib'),
|
|
|
11 |
);
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -11,5 +11,6 @@ return array(
|
|
11 |
'Sudzy\\' => array($baseDir . '/lib/Util/Sudzy'),
|
12 |
'MailPoet\\' => array($baseDir . '/lib'),
|
13 |
'Html2Text\\' => array($vendorDir . '/soundasleep/html2text/src'),
|
|
|
14 |
'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),
|
15 |
);
|
11 |
'Sudzy\\' => array($baseDir . '/lib/Util/Sudzy'),
|
12 |
'MailPoet\\' => array($baseDir . '/lib'),
|
13 |
'Html2Text\\' => array($vendorDir . '/soundasleep/html2text/src'),
|
14 |
+
'Cron\\' => array($vendorDir . '/mtdowling/cron-expression/src/Cron'),
|
15 |
'Carbon\\' => array($vendorDir . '/nesbot/carbon/src/Carbon'),
|
16 |
);
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -19,15 +19,15 @@ class ComposerAutoloaderInit1cede32ff3b7e24593849743769fc31a
|
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
-
spl_autoload_register(array('
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
-
spl_autoload_unregister(array('
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
-
call_user_func(\Composer\Autoload\
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
@@ -48,19 +48,19 @@ class ComposerAutoloaderInit1cede32ff3b7e24593849743769fc31a
|
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
-
$includeFiles = Composer\Autoload\
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
-
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
-
function
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit5331c916d5c60c1cf869dcbb6cd2c0be
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
19 |
return self::$loader;
|
20 |
}
|
21 |
|
22 |
+
spl_autoload_register(array('ComposerAutoloaderInit5331c916d5c60c1cf869dcbb6cd2c0be', 'loadClassLoader'), true, true);
|
23 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
24 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit5331c916d5c60c1cf869dcbb6cd2c0be', 'loadClassLoader'));
|
25 |
|
26 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
27 |
if ($useStaticLoader) {
|
28 |
require_once __DIR__ . '/autoload_static.php';
|
29 |
|
30 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit5331c916d5c60c1cf869dcbb6cd2c0be::getInitializer($loader));
|
31 |
} else {
|
32 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
33 |
foreach ($map as $namespace => $path) {
|
48 |
$loader->register(true);
|
49 |
|
50 |
if ($useStaticLoader) {
|
51 |
+
$includeFiles = Composer\Autoload\ComposerStaticInit5331c916d5c60c1cf869dcbb6cd2c0be::$files;
|
52 |
} else {
|
53 |
$includeFiles = require __DIR__ . '/autoload_files.php';
|
54 |
}
|
55 |
foreach ($includeFiles as $fileIdentifier => $file) {
|
56 |
+
composerRequire5331c916d5c60c1cf869dcbb6cd2c0be($fileIdentifier, $file);
|
57 |
}
|
58 |
|
59 |
return $loader;
|
60 |
}
|
61 |
}
|
62 |
|
63 |
+
function composerRequire5331c916d5c60c1cf869dcbb6cd2c0be($fileIdentifier, $file)
|
64 |
{
|
65 |
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
66 |
require $file;
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
@@ -28,6 +28,7 @@ class ComposerStaticInit1cede32ff3b7e24593849743769fc31a
|
|
28 |
),
|
29 |
'C' =>
|
30 |
array (
|
|
|
31 |
'Carbon\\' => 7,
|
32 |
),
|
33 |
);
|
@@ -53,6 +54,10 @@ class ComposerStaticInit1cede32ff3b7e24593849743769fc31a
|
|
53 |
array (
|
54 |
0 => __DIR__ . '/..' . '/soundasleep/html2text/src',
|
55 |
),
|
|
|
|
|
|
|
|
|
56 |
'Carbon\\' =>
|
57 |
array (
|
58 |
0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon',
|
@@ -74,18 +79,12 @@ class ComposerStaticInit1cede32ff3b7e24593849743769fc31a
|
|
74 |
0 => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib',
|
75 |
),
|
76 |
),
|
77 |
-
'C' =>
|
78 |
-
array (
|
79 |
-
'Cron' =>
|
80 |
-
array (
|
81 |
-
0 => __DIR__ . '/..' . '/mtdowling/cron-expression/src',
|
82 |
-
),
|
83 |
-
),
|
84 |
);
|
85 |
|
86 |
public static $classMap = array (
|
87 |
'Carbon\\Carbon' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Carbon.php',
|
88 |
'Carbon\\CarbonInterval' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/CarbonInterval.php',
|
|
|
89 |
'Cron\\AbstractField' => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron/AbstractField.php',
|
90 |
'Cron\\CronExpression' => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron/CronExpression.php',
|
91 |
'Cron\\DayOfMonthField' => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron/DayOfMonthField.php',
|
@@ -282,6 +281,9 @@ class ComposerStaticInit1cede32ff3b7e24593849743769fc31a
|
|
282 |
'MailPoet\\Util\\Url' => __DIR__ . '/../..' . '/lib/Util/Url.php',
|
283 |
'MailPoet\\Util\\XLSXWriter' => __DIR__ . '/../..' . '/lib/Util/XLSXWriter.php',
|
284 |
'MailPoet\\Util\\XLSXWriter_BuffererWriter' => __DIR__ . '/../..' . '/lib/Util/XLSXWriter.php',
|
|
|
|
|
|
|
285 |
'MailPoet\\WP\\DateTime' => __DIR__ . '/../..' . '/lib/WP/DateTime.php',
|
286 |
'MailPoet\\WP\\Notice' => __DIR__ . '/../..' . '/lib/WP/Notice.php',
|
287 |
'MailPoet\\WP\\Readme' => __DIR__ . '/../..' . '/lib/WP/Readme.php',
|
@@ -606,10 +608,10 @@ class ComposerStaticInit1cede32ff3b7e24593849743769fc31a
|
|
606 |
public static function getInitializer(ClassLoader $loader)
|
607 |
{
|
608 |
return \Closure::bind(function () use ($loader) {
|
609 |
-
$loader->prefixLengthsPsr4 =
|
610 |
-
$loader->prefixDirsPsr4 =
|
611 |
-
$loader->prefixesPsr0 =
|
612 |
-
$loader->classMap =
|
613 |
|
614 |
}, null, ClassLoader::class);
|
615 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit5331c916d5c60c1cf869dcbb6cd2c0be
|
8 |
{
|
9 |
public static $files = array (
|
10 |
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
28 |
),
|
29 |
'C' =>
|
30 |
array (
|
31 |
+
'Cron\\' => 5,
|
32 |
'Carbon\\' => 7,
|
33 |
),
|
34 |
);
|
54 |
array (
|
55 |
0 => __DIR__ . '/..' . '/soundasleep/html2text/src',
|
56 |
),
|
57 |
+
'Cron\\' =>
|
58 |
+
array (
|
59 |
+
0 => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron',
|
60 |
+
),
|
61 |
'Carbon\\' =>
|
62 |
array (
|
63 |
0 => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon',
|
79 |
0 => __DIR__ . '/..' . '/sabberworm/php-css-parser/lib',
|
80 |
),
|
81 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
);
|
83 |
|
84 |
public static $classMap = array (
|
85 |
'Carbon\\Carbon' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Carbon.php',
|
86 |
'Carbon\\CarbonInterval' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/CarbonInterval.php',
|
87 |
+
'Carbon\\Exceptions\\InvalidDateException' => __DIR__ . '/..' . '/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php',
|
88 |
'Cron\\AbstractField' => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron/AbstractField.php',
|
89 |
'Cron\\CronExpression' => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron/CronExpression.php',
|
90 |
'Cron\\DayOfMonthField' => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron/DayOfMonthField.php',
|
281 |
'MailPoet\\Util\\Url' => __DIR__ . '/../..' . '/lib/Util/Url.php',
|
282 |
'MailPoet\\Util\\XLSXWriter' => __DIR__ . '/../..' . '/lib/Util/XLSXWriter.php',
|
283 |
'MailPoet\\Util\\XLSXWriter_BuffererWriter' => __DIR__ . '/../..' . '/lib/Util/XLSXWriter.php',
|
284 |
+
'MailPoet\\Util\\pQuery\\DomNode' => __DIR__ . '/../..' . '/lib/Util/pQuery/pQuery.php',
|
285 |
+
'MailPoet\\Util\\pQuery\\Html5Parser' => __DIR__ . '/../..' . '/lib/Util/pQuery/pQuery.php',
|
286 |
+
'MailPoet\\Util\\pQuery\\pQuery' => __DIR__ . '/../..' . '/lib/Util/pQuery/pQuery.php',
|
287 |
'MailPoet\\WP\\DateTime' => __DIR__ . '/../..' . '/lib/WP/DateTime.php',
|
288 |
'MailPoet\\WP\\Notice' => __DIR__ . '/../..' . '/lib/WP/Notice.php',
|
289 |
'MailPoet\\WP\\Readme' => __DIR__ . '/../..' . '/lib/WP/Readme.php',
|
608 |
public static function getInitializer(ClassLoader $loader)
|
609 |
{
|
610 |
return \Closure::bind(function () use ($loader) {
|
611 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit5331c916d5c60c1cf869dcbb6cd2c0be::$prefixLengthsPsr4;
|
612 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit5331c916d5c60c1cf869dcbb6cd2c0be::$prefixDirsPsr4;
|
613 |
+
$loader->prefixesPsr0 = ComposerStaticInit5331c916d5c60c1cf869dcbb6cd2c0be::$prefixesPsr0;
|
614 |
+
$loader->classMap = ComposerStaticInit5331c916d5c60c1cf869dcbb6cd2c0be::$classMap;
|
615 |
|
616 |
}, null, ClassLoader::class);
|
617 |
}
|
vendor/composer/installed.json
CHANGED
@@ -161,17 +161,17 @@
|
|
161 |
},
|
162 |
{
|
163 |
"name": "mtdowling/cron-expression",
|
164 |
-
"version": "v1.
|
165 |
-
"version_normalized": "1.
|
166 |
"source": {
|
167 |
"type": "git",
|
168 |
"url": "https://github.com/mtdowling/cron-expression.git",
|
169 |
-
"reference": "
|
170 |
},
|
171 |
"dist": {
|
172 |
"type": "zip",
|
173 |
-
"url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/
|
174 |
-
"reference": "
|
175 |
"shasum": ""
|
176 |
},
|
177 |
"require": {
|
@@ -180,12 +180,12 @@
|
|
180 |
"require-dev": {
|
181 |
"phpunit/phpunit": "~4.0|~5.0"
|
182 |
},
|
183 |
-
"time": "
|
184 |
"type": "library",
|
185 |
"installation-source": "dist",
|
186 |
"autoload": {
|
187 |
-
"psr-
|
188 |
-
"Cron": "src/"
|
189 |
}
|
190 |
},
|
191 |
"notification-url": "https://packagist.org/downloads/",
|
@@ -268,17 +268,17 @@
|
|
268 |
},
|
269 |
{
|
270 |
"name": "symfony/translation",
|
271 |
-
"version": "v2.8.
|
272 |
-
"version_normalized": "2.8.
|
273 |
"source": {
|
274 |
"type": "git",
|
275 |
"url": "https://github.com/symfony/translation.git",
|
276 |
-
"reference": "
|
277 |
},
|
278 |
"dist": {
|
279 |
"type": "zip",
|
280 |
-
"url": "https://api.github.com/repos/symfony/translation/zipball/
|
281 |
-
"reference": "
|
282 |
"shasum": ""
|
283 |
},
|
284 |
"require": {
|
@@ -299,7 +299,7 @@
|
|
299 |
"symfony/config": "",
|
300 |
"symfony/yaml": ""
|
301 |
},
|
302 |
-
"time": "2017-01-
|
303 |
"type": "library",
|
304 |
"extra": {
|
305 |
"branch-alias": {
|
@@ -334,28 +334,34 @@
|
|
334 |
},
|
335 |
{
|
336 |
"name": "nesbot/carbon",
|
337 |
-
"version": "1.
|
338 |
-
"version_normalized": "1.
|
339 |
"source": {
|
340 |
"type": "git",
|
341 |
"url": "https://github.com/briannesbitt/Carbon.git",
|
342 |
-
"reference": "
|
343 |
},
|
344 |
"dist": {
|
345 |
"type": "zip",
|
346 |
-
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/
|
347 |
-
"reference": "
|
348 |
"shasum": ""
|
349 |
},
|
350 |
"require": {
|
351 |
"php": ">=5.3.0",
|
352 |
-
"symfony/translation": "~2.6
|
353 |
},
|
354 |
"require-dev": {
|
355 |
-
"
|
|
|
356 |
},
|
357 |
-
"time": "
|
358 |
"type": "library",
|
|
|
|
|
|
|
|
|
|
|
359 |
"installation-source": "dist",
|
360 |
"autoload": {
|
361 |
"psr-4": {
|
161 |
},
|
162 |
{
|
163 |
"name": "mtdowling/cron-expression",
|
164 |
+
"version": "v1.2.0",
|
165 |
+
"version_normalized": "1.2.0.0",
|
166 |
"source": {
|
167 |
"type": "git",
|
168 |
"url": "https://github.com/mtdowling/cron-expression.git",
|
169 |
+
"reference": "9504fa9ea681b586028adaaa0877db4aecf32bad"
|
170 |
},
|
171 |
"dist": {
|
172 |
"type": "zip",
|
173 |
+
"url": "https://api.github.com/repos/mtdowling/cron-expression/zipball/9504fa9ea681b586028adaaa0877db4aecf32bad",
|
174 |
+
"reference": "9504fa9ea681b586028adaaa0877db4aecf32bad",
|
175 |
"shasum": ""
|
176 |
},
|
177 |
"require": {
|
180 |
"require-dev": {
|
181 |
"phpunit/phpunit": "~4.0|~5.0"
|
182 |
},
|
183 |
+
"time": "2017-01-23 04:29:33",
|
184 |
"type": "library",
|
185 |
"installation-source": "dist",
|
186 |
"autoload": {
|
187 |
+
"psr-4": {
|
188 |
+
"Cron\\": "src/Cron/"
|
189 |
}
|
190 |
},
|
191 |
"notification-url": "https://packagist.org/downloads/",
|
268 |
},
|
269 |
{
|
270 |
"name": "symfony/translation",
|
271 |
+
"version": "v2.8.17",
|
272 |
+
"version_normalized": "2.8.17.0",
|
273 |
"source": {
|
274 |
"type": "git",
|
275 |
"url": "https://github.com/symfony/translation.git",
|
276 |
+
"reference": "c281ac2b484210bb95106bdb8ae8356e63277725"
|
277 |
},
|
278 |
"dist": {
|
279 |
"type": "zip",
|
280 |
+
"url": "https://api.github.com/repos/symfony/translation/zipball/c281ac2b484210bb95106bdb8ae8356e63277725",
|
281 |
+
"reference": "c281ac2b484210bb95106bdb8ae8356e63277725",
|
282 |
"shasum": ""
|
283 |
},
|
284 |
"require": {
|
299 |
"symfony/config": "",
|
300 |
"symfony/yaml": ""
|
301 |
},
|
302 |
+
"time": "2017-01-21 16:59:38",
|
303 |
"type": "library",
|
304 |
"extra": {
|
305 |
"branch-alias": {
|
334 |
},
|
335 |
{
|
336 |
"name": "nesbot/carbon",
|
337 |
+
"version": "1.22.1",
|
338 |
+
"version_normalized": "1.22.1.0",
|
339 |
"source": {
|
340 |
"type": "git",
|
341 |
"url": "https://github.com/briannesbitt/Carbon.git",
|
342 |
+
"reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc"
|
343 |
},
|
344 |
"dist": {
|
345 |
"type": "zip",
|
346 |
+
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
|
347 |
+
"reference": "7cdf42c0b1cc763ab7e4c33c47a24e27c66bfccc",
|
348 |
"shasum": ""
|
349 |
},
|
350 |
"require": {
|
351 |
"php": ">=5.3.0",
|
352 |
+
"symfony/translation": "~2.6 || ~3.0"
|
353 |
},
|
354 |
"require-dev": {
|
355 |
+
"friendsofphp/php-cs-fixer": "~2",
|
356 |
+
"phpunit/phpunit": "~4.0 || ~5.0"
|
357 |
},
|
358 |
+
"time": "2017-01-16 07:55:07",
|
359 |
"type": "library",
|
360 |
+
"extra": {
|
361 |
+
"branch-alias": {
|
362 |
+
"dev-master": "1.23-dev"
|
363 |
+
}
|
364 |
+
},
|
365 |
"installation-source": "dist",
|
366 |
"autoload": {
|
367 |
"psr-4": {
|
vendor/mtdowling/cron-expression/composer.json
CHANGED
@@ -16,8 +16,13 @@
|
|
16 |
"phpunit/phpunit": "~4.0|~5.0"
|
17 |
},
|
18 |
"autoload": {
|
19 |
-
"psr-
|
20 |
-
"Cron": "src/"
|
|
|
|
|
|
|
|
|
|
|
21 |
}
|
22 |
}
|
23 |
}
|
16 |
"phpunit/phpunit": "~4.0|~5.0"
|
17 |
},
|
18 |
"autoload": {
|
19 |
+
"psr-4": {
|
20 |
+
"Cron\\": "src/Cron/"
|
21 |
+
}
|
22 |
+
},
|
23 |
+
"autoload-dev": {
|
24 |
+
"psr-4": {
|
25 |
+
"Tests\\": "tests/Cron/"
|
26 |
}
|
27 |
}
|
28 |
}
|
vendor/mtdowling/cron-expression/src/Cron/AbstractField.php
CHANGED
@@ -76,8 +76,13 @@ abstract class AbstractField implements FieldInterface
|
|
76 |
public function isInIncrementsOfRanges($dateValue, $value)
|
77 |
{
|
78 |
$parts = array_map('trim', explode('/', $value, 2));
|
79 |
-
$stepSize = isset($parts[1]) ? $parts[1] : 0;
|
80 |
-
|
|
|
|
|
|
|
|
|
|
|
81 |
return (int) $dateValue % $stepSize == 0;
|
82 |
}
|
83 |
|
76 |
public function isInIncrementsOfRanges($dateValue, $value)
|
77 |
{
|
78 |
$parts = array_map('trim', explode('/', $value, 2));
|
79 |
+
$stepSize = isset($parts[1]) ? (int) $parts[1] : 0;
|
80 |
+
|
81 |
+
if ($stepSize === 0) {
|
82 |
+
return false;
|
83 |
+
}
|
84 |
+
|
85 |
+
if (($parts[0] == '*' || $parts[0] === '0')) {
|
86 |
return (int) $dateValue % $stepSize == 0;
|
87 |
}
|
88 |
|
vendor/mtdowling/cron-expression/src/Cron/CronExpression.php
CHANGED
@@ -2,6 +2,13 @@
|
|
2 |
|
3 |
namespace Cron;
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
/**
|
6 |
* CRON expression parser that can determine whether or not a CRON expression is
|
7 |
* due to run, the next run date and previous run date of a CRON expression.
|
@@ -83,13 +90,13 @@ class CronExpression
|
|
83 |
* @param string $expression The CRON expression to validate.
|
84 |
*
|
85 |
* @return bool True if a valid CRON expression was passed. False if not.
|
86 |
-
* @see Cron\CronExpression::factory
|
87 |
*/
|
88 |
public static function isValidExpression($expression)
|
89 |
{
|
90 |
try {
|
91 |
self::factory($expression);
|
92 |
-
} catch (
|
93 |
return false;
|
94 |
}
|
95 |
|
@@ -120,7 +127,7 @@ class CronExpression
|
|
120 |
{
|
121 |
$this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
|
122 |
if (count($this->cronParts) < 5) {
|
123 |
-
throw new
|
124 |
$value . ' is not a valid CRON expression'
|
125 |
);
|
126 |
}
|
@@ -144,7 +151,7 @@ class CronExpression
|
|
144 |
public function setPart($position, $value)
|
145 |
{
|
146 |
if (!$this->fieldFactory->getField($position)->validate($value)) {
|
147 |
-
throw new
|
148 |
'Invalid CRON field value ' . $value . ' at position ' . $position
|
149 |
);
|
150 |
}
|
@@ -199,7 +206,7 @@ class CronExpression
|
|
199 |
*
|
200 |
* @return \DateTime
|
201 |
* @throws \RuntimeException on too many iterations
|
202 |
-
* @see Cron\CronExpression::getNextRunDate
|
203 |
*/
|
204 |
public function getPreviousRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false)
|
205 |
{
|
@@ -223,7 +230,7 @@ class CronExpression
|
|
223 |
for ($i = 0; $i < max(0, $total); $i++) {
|
224 |
try {
|
225 |
$matches[] = $this->getRunDate($currentTime, $i, $invert, $allowCurrentDate);
|
226 |
-
} catch (
|
227 |
break;
|
228 |
}
|
229 |
}
|
@@ -275,19 +282,19 @@ class CronExpression
|
|
275 |
if ('now' === $currentTime) {
|
276 |
$currentDate = date('Y-m-d H:i');
|
277 |
$currentTime = strtotime($currentDate);
|
278 |
-
} elseif ($currentTime instanceof
|
279 |
$currentDate = clone $currentTime;
|
280 |
// Ensure time in 'current' timezone is used
|
281 |
-
$currentDate->setTimezone(new
|
282 |
$currentDate = $currentDate->format('Y-m-d H:i');
|
283 |
$currentTime = strtotime($currentDate);
|
284 |
-
} elseif ($currentTime instanceof
|
285 |
-
$currentDate =
|
286 |
-
$currentDate->setTimezone(new
|
287 |
$currentDate = $currentDate->format('Y-m-d H:i');
|
288 |
$currentTime = strtotime($currentDate);
|
289 |
} else {
|
290 |
-
$currentTime = new
|
291 |
$currentTime->setTime($currentTime->format('H'), $currentTime->format('i'), 0);
|
292 |
$currentDate = $currentTime->format('Y-m-d H:i');
|
293 |
$currentTime = $currentTime->getTimeStamp();
|
@@ -295,7 +302,7 @@ class CronExpression
|
|
295 |
|
296 |
try {
|
297 |
return $this->getNextRunDate($currentDate, 0, true)->getTimestamp() == $currentTime;
|
298 |
-
} catch (
|
299 |
return false;
|
300 |
}
|
301 |
}
|
@@ -314,14 +321,14 @@ class CronExpression
|
|
314 |
*/
|
315 |
protected function getRunDate($currentTime = null, $nth = 0, $invert = false, $allowCurrentDate = false)
|
316 |
{
|
317 |
-
if ($currentTime instanceof
|
318 |
$currentDate = clone $currentTime;
|
319 |
-
} elseif ($currentTime instanceof
|
320 |
-
$currentDate =
|
321 |
$currentDate->setTimezone($currentTime->getTimezone());
|
322 |
} else {
|
323 |
-
$currentDate = new
|
324 |
-
$currentDate->setTimezone(new
|
325 |
}
|
326 |
|
327 |
$currentDate->setTime($currentDate->format('H'), $currentDate->format('i'), 0);
|
@@ -376,7 +383,7 @@ class CronExpression
|
|
376 |
}
|
377 |
|
378 |
// @codeCoverageIgnoreStart
|
379 |
-
throw new
|
380 |
// @codeCoverageIgnoreEnd
|
381 |
}
|
382 |
}
|
2 |
|
3 |
namespace Cron;
|
4 |
|
5 |
+
use DateTime;
|
6 |
+
use DateTimeImmutable;
|
7 |
+
use DateTimeZone;
|
8 |
+
use Exception;
|
9 |
+
use InvalidArgumentException;
|
10 |
+
use RuntimeException;
|
11 |
+
|
12 |
/**
|
13 |
* CRON expression parser that can determine whether or not a CRON expression is
|
14 |
* due to run, the next run date and previous run date of a CRON expression.
|
90 |
* @param string $expression The CRON expression to validate.
|
91 |
*
|
92 |
* @return bool True if a valid CRON expression was passed. False if not.
|
93 |
+
* @see \Cron\CronExpression::factory
|
94 |
*/
|
95 |
public static function isValidExpression($expression)
|
96 |
{
|
97 |
try {
|
98 |
self::factory($expression);
|
99 |
+
} catch (InvalidArgumentException $e) {
|
100 |
return false;
|
101 |
}
|
102 |
|
127 |
{
|
128 |
$this->cronParts = preg_split('/\s/', $value, -1, PREG_SPLIT_NO_EMPTY);
|
129 |
if (count($this->cronParts) < 5) {
|
130 |
+
throw new InvalidArgumentException(
|
131 |
$value . ' is not a valid CRON expression'
|
132 |
);
|
133 |
}
|
151 |
public function setPart($position, $value)
|
152 |
{
|
153 |
if (!$this->fieldFactory->getField($position)->validate($value)) {
|
154 |
+
throw new InvalidArgumentException(
|
155 |
'Invalid CRON field value ' . $value . ' at position ' . $position
|
156 |
);
|
157 |
}
|
206 |
*
|
207 |
* @return \DateTime
|
208 |
* @throws \RuntimeException on too many iterations
|
209 |
+
* @see \Cron\CronExpression::getNextRunDate
|
210 |
*/
|
211 |
public function getPreviousRunDate($currentTime = 'now', $nth = 0, $allowCurrentDate = false)
|
212 |
{
|
230 |
for ($i = 0; $i < max(0, $total); $i++) {
|
231 |
try {
|
232 |
$matches[] = $this->getRunDate($currentTime, $i, $invert, $allowCurrentDate);
|
233 |
+
} catch (RuntimeException $e) {
|
234 |
break;
|
235 |
}
|
236 |
}
|
282 |
if ('now' === $currentTime) {
|
283 |
$currentDate = date('Y-m-d H:i');
|
284 |
$currentTime = strtotime($currentDate);
|
285 |
+
} elseif ($currentTime instanceof DateTime) {
|
286 |
$currentDate = clone $currentTime;
|
287 |
// Ensure time in 'current' timezone is used
|
288 |
+
$currentDate->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
289 |
$currentDate = $currentDate->format('Y-m-d H:i');
|
290 |
$currentTime = strtotime($currentDate);
|
291 |
+
} elseif ($currentTime instanceof DateTimeImmutable) {
|
292 |
+
$currentDate = DateTime::createFromFormat('U', $currentTime->format('U'));
|
293 |
+
$currentDate->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
294 |
$currentDate = $currentDate->format('Y-m-d H:i');
|
295 |
$currentTime = strtotime($currentDate);
|
296 |
} else {
|
297 |
+
$currentTime = new DateTime($currentTime);
|
298 |
$currentTime->setTime($currentTime->format('H'), $currentTime->format('i'), 0);
|
299 |
$currentDate = $currentTime->format('Y-m-d H:i');
|
300 |
$currentTime = $currentTime->getTimeStamp();
|
302 |
|
303 |
try {
|
304 |
return $this->getNextRunDate($currentDate, 0, true)->getTimestamp() == $currentTime;
|
305 |
+
} catch (Exception $e) {
|
306 |
return false;
|
307 |
}
|
308 |
}
|
321 |
*/
|
322 |
protected function getRunDate($currentTime = null, $nth = 0, $invert = false, $allowCurrentDate = false)
|
323 |
{
|
324 |
+
if ($currentTime instanceof DateTime) {
|
325 |
$currentDate = clone $currentTime;
|
326 |
+
} elseif ($currentTime instanceof DateTimeImmutable) {
|
327 |
+
$currentDate = DateTime::createFromFormat('U', $currentTime->format('U'));
|
328 |
$currentDate->setTimezone($currentTime->getTimezone());
|
329 |
} else {
|
330 |
+
$currentDate = new DateTime($currentTime ?: 'now');
|
331 |
+
$currentDate->setTimezone(new DateTimeZone(date_default_timezone_get()));
|
332 |
}
|
333 |
|
334 |
$currentDate->setTime($currentDate->format('H'), $currentDate->format('i'), 0);
|
383 |
}
|
384 |
|
385 |
// @codeCoverageIgnoreStart
|
386 |
+
throw new RuntimeException('Impossible CRON expression');
|
387 |
// @codeCoverageIgnoreEnd
|
388 |
}
|
389 |
}
|
vendor/mtdowling/cron-expression/src/Cron/DayOfMonthField.php
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
|
3 |
namespace Cron;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* Day of month field. Allows: * , / - ? L W
|
7 |
*
|
@@ -34,7 +36,7 @@ class DayOfMonthField extends AbstractField
|
|
34 |
private static function getNearestWeekday($currentYear, $currentMonth, $targetDay)
|
35 |
{
|
36 |
$tday = str_pad($targetDay, 2, '0', STR_PAD_LEFT);
|
37 |
-
$target =
|
38 |
$currentWeekday = (int) $target->format('N');
|
39 |
|
40 |
if ($currentWeekday < 6) {
|
@@ -54,7 +56,7 @@ class DayOfMonthField extends AbstractField
|
|
54 |
}
|
55 |
}
|
56 |
|
57 |
-
public function isSatisfiedBy(
|
58 |
{
|
59 |
// ? states that the field value is to be skipped
|
60 |
if ($value == '?') {
|
@@ -83,7 +85,7 @@ class DayOfMonthField extends AbstractField
|
|
83 |
return $this->isSatisfied($date->format('d'), $value);
|
84 |
}
|
85 |
|
86 |
-
public function increment(
|
87 |
{
|
88 |
if ($invert) {
|
89 |
$date->modify('previous day');
|
@@ -96,8 +98,76 @@ class DayOfMonthField extends AbstractField
|
|
96 |
return $this;
|
97 |
}
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
public function validate($value)
|
100 |
{
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
}
|
2 |
|
3 |
namespace Cron;
|
4 |
|
5 |
+
use DateTime;
|
6 |
+
|
7 |
/**
|
8 |
* Day of month field. Allows: * , / - ? L W
|
9 |
*
|
36 |
private static function getNearestWeekday($currentYear, $currentMonth, $targetDay)
|
37 |
{
|
38 |
$tday = str_pad($targetDay, 2, '0', STR_PAD_LEFT);
|
39 |
+
$target = DateTime::createFromFormat('Y-m-d', "$currentYear-$currentMonth-$tday");
|
40 |
$currentWeekday = (int) $target->format('N');
|
41 |
|
42 |
if ($currentWeekday < 6) {
|
56 |
}
|
57 |
}
|
58 |
|
59 |
+
public function isSatisfiedBy(DateTime $date, $value)
|
60 |
{
|
61 |
// ? states that the field value is to be skipped
|
62 |
if ($value == '?') {
|
85 |
return $this->isSatisfied($date->format('d'), $value);
|
86 |
}
|
87 |
|
88 |
+
public function increment(DateTime $date, $invert = false)
|
89 |
{
|
90 |
if ($invert) {
|
91 |
$date->modify('previous day');
|
98 |
return $this;
|
99 |
}
|
100 |
|
101 |
+
/**
|
102 |
+
* Validates that the value is valid for the Day of the Month field
|
103 |
+
* Days of the month can contain values of 1-31, *, L, or ? by default. This can be augmented with lists via a ',',
|
104 |
+
* ranges via a '-', or with a '[0-9]W' to specify the closest weekday.
|
105 |
+
*
|
106 |
+
* @param string $value
|
107 |
+
* @return bool
|
108 |
+
*/
|
109 |
public function validate($value)
|
110 |
{
|
111 |
+
// Allow wildcards and a single L
|
112 |
+
if ($value === '?' || $value === '*' || $value === 'L') {
|
113 |
+
return true;
|
114 |
+
}
|
115 |
+
|
116 |
+
// If you only contain numbers and are within 1-31
|
117 |
+
if ((bool) preg_match('/^\d{1,2}$/', $value) && ($value >= 1 && $value <= 31)) {
|
118 |
+
return true;
|
119 |
+
}
|
120 |
+
|
121 |
+
// If you have a -, we will deal with each of your chunks
|
122 |
+
if ((bool) preg_match('/-/', $value)) {
|
123 |
+
// We cannot have a range within a list or vice versa
|
124 |
+
if ((bool) preg_match('/,/', $value)) {
|
125 |
+
return false;
|
126 |
+
}
|
127 |
+
|
128 |
+
$chunks = explode('-', $value);
|
129 |
+
foreach ($chunks as $chunk) {
|
130 |
+
if (!$this->validate($chunk)) {
|
131 |
+
return false;
|
132 |
+
}
|
133 |
+
}
|
134 |
+
|
135 |
+
return true;
|
136 |
+
}
|
137 |
+
|
138 |
+
// If you have a comma, we will deal with each value
|
139 |
+
if ((bool) preg_match('/,/', $value)) {
|
140 |
+
// We cannot have a range within a list or vice versa
|
141 |
+
if ((bool) preg_match('/-/', $value)) {
|
142 |
+
return false;
|
143 |
+
}
|
144 |
+
|
145 |
+
$chunks = explode(',', $value);
|
146 |
+
foreach ($chunks as $chunk) {
|
147 |
+
if (!$this->validate($chunk)) {
|
148 |
+
return false;
|
149 |
+
}
|
150 |
+
}
|
151 |
+
|
152 |
+
return true;
|
153 |
+
}
|
154 |
+
|
155 |
+
// If you contain a /, we'll deal with it
|
156 |
+
if ((bool) preg_match('/\//', $value)) {
|
157 |
+
$chunks = explode('/', $value);
|
158 |
+
foreach ($chunks as $chunk) {
|
159 |
+
if (!$this->validate($chunk)) {
|
160 |
+
return false;
|
161 |
+
}
|
162 |
+
}
|
163 |
+
return true;
|
164 |
+
}
|
165 |
+
|
166 |
+
// If you end in W, make sure that it has a numeric in front of it
|
167 |
+
if ((bool) preg_match('/^\d{1,2}W$/', $value)) {
|
168 |
+
return true;
|
169 |
+
}
|
170 |
+
|
171 |
+
return false;
|
172 |
}
|
173 |
}
|
vendor/mtdowling/cron-expression/src/Cron/DayOfWeekField.php
CHANGED
@@ -2,6 +2,10 @@
|
|
2 |
|
3 |
namespace Cron;
|
4 |
|
|
|
|
|
|
|
|
|
5 |
/**
|
6 |
* Day of week field. Allows: * / , - ? L #
|
7 |
*
|
@@ -17,7 +21,7 @@ namespace Cron;
|
|
17 |
*/
|
18 |
class DayOfWeekField extends AbstractField
|
19 |
{
|
20 |
-
public function isSatisfiedBy(
|
21 |
{
|
22 |
if ($value == '?') {
|
23 |
return true;
|
@@ -36,7 +40,7 @@ class DayOfWeekField extends AbstractField
|
|
36 |
$tdate = clone $date;
|
37 |
$tdate->setDate($currentYear, $currentMonth, $lastDayOfMonth);
|
38 |
while ($tdate->format('w') != $weekday) {
|
39 |
-
$tdateClone = new
|
40 |
$tdate = $tdateClone
|
41 |
->setTimezone($tdate->getTimezone())
|
42 |
->setDate($currentYear, $currentMonth, --$lastDayOfMonth);
|
@@ -56,10 +60,10 @@ class DayOfWeekField extends AbstractField
|
|
56 |
|
57 |
// Validate the hash fields
|
58 |
if ($weekday < 0 || $weekday > 7) {
|
59 |
-
throw new
|
60 |
}
|
61 |
if ($nth > 5) {
|
62 |
-
throw new
|
63 |
}
|
64 |
// The current weekday must match the targeted weekday to proceed
|
65 |
if ($date->format('N') != $weekday) {
|
@@ -100,7 +104,7 @@ class DayOfWeekField extends AbstractField
|
|
100 |
return $this->isSatisfied($fieldValue, $value);
|
101 |
}
|
102 |
|
103 |
-
public function increment(
|
104 |
{
|
105 |
if ($invert) {
|
106 |
$date->modify('-1 day');
|
2 |
|
3 |
namespace Cron;
|
4 |
|
5 |
+
use DateTime;
|
6 |
+
use InvalidArgumentException;
|
7 |
+
|
8 |
+
|
9 |
/**
|
10 |
* Day of week field. Allows: * / , - ? L #
|
11 |
*
|
21 |
*/
|
22 |
class DayOfWeekField extends AbstractField
|
23 |
{
|
24 |
+
public function isSatisfiedBy(DateTime $date, $value)
|
25 |
{
|
26 |
if ($value == '?') {
|
27 |
return true;
|
40 |
$tdate = clone $date;
|
41 |
$tdate->setDate($currentYear, $currentMonth, $lastDayOfMonth);
|
42 |
while ($tdate->format('w') != $weekday) {
|
43 |
+
$tdateClone = new DateTime();
|
44 |
$tdate = $tdateClone
|
45 |
->setTimezone($tdate->getTimezone())
|
46 |
->setDate($currentYear, $currentMonth, --$lastDayOfMonth);
|
60 |
|
61 |
// Validate the hash fields
|
62 |
if ($weekday < 0 || $weekday > 7) {
|
63 |
+
throw new InvalidArgumentException("Weekday must be a value between 0 and 7. {$weekday} given");
|
64 |
}
|
65 |
if ($nth > 5) {
|
66 |
+
throw new InvalidArgumentException('There are never more than 5 of a given weekday in a month');
|
67 |
}
|
68 |
// The current weekday must match the targeted weekday to proceed
|
69 |
if ($date->format('N') != $weekday) {
|
104 |
return $this->isSatisfied($fieldValue, $value);
|
105 |
}
|
106 |
|
107 |
+
public function increment(DateTime $date, $invert = false)
|
108 |
{
|
109 |
if ($invert) {
|
110 |
$date->modify('-1 day');
|
vendor/mtdowling/cron-expression/src/Cron/FieldFactory.php
CHANGED
@@ -2,6 +2,8 @@
|
|
2 |
|
3 |
namespace Cron;
|
4 |
|
|
|
|
|
5 |
/**
|
6 |
* CRON field factory implementing a flyweight factory
|
7 |
* @link http://en.wikipedia.org/wiki/Cron
|
@@ -44,7 +46,7 @@ class FieldFactory
|
|
44 |
$this->fields[$position] = new YearField();
|
45 |
break;
|
46 |
default:
|
47 |
-
throw new
|
48 |
$position . ' is not a valid position'
|
49 |
);
|
50 |
}
|
2 |
|
3 |
namespace Cron;
|
4 |
|
5 |
+
use InvalidArgumentException;
|
6 |
+
|
7 |
/**
|
8 |
* CRON field factory implementing a flyweight factory
|
9 |
* @link http://en.wikipedia.org/wiki/Cron
|
46 |
$this->fields[$position] = new YearField();
|
47 |
break;
|
48 |
default:
|
49 |
+
throw new InvalidArgumentException(
|
50 |
$position . ' is not a valid position'
|
51 |
);
|
52 |
}
|
vendor/mtdowling/cron-expression/src/Cron/FieldInterface.php
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
namespace Cron;
|
|
|
4 |
|
5 |
/**
|
6 |
* CRON field interface
|
@@ -15,7 +16,7 @@ interface FieldInterface
|
|
15 |
*
|
16 |
* @return bool Returns TRUE if satisfied, FALSE otherwise
|
17 |
*/
|
18 |
-
public function isSatisfiedBy(
|
19 |
|
20 |
/**
|
21 |
* When a CRON expression is not satisfied, this method is used to increment
|
@@ -26,7 +27,7 @@ interface FieldInterface
|
|
26 |
*
|
27 |
* @return FieldInterface
|
28 |
*/
|
29 |
-
public function increment(
|
30 |
|
31 |
/**
|
32 |
* Validates a CRON expression for a given field
|
1 |
<?php
|
2 |
|
3 |
namespace Cron;
|
4 |
+
use DateTime;
|
5 |
|
6 |
/**
|
7 |
* CRON field interface
|
16 |
*
|
17 |
* @return bool Returns TRUE if satisfied, FALSE otherwise
|
18 |
*/
|
19 |
+
public function isSatisfiedBy(DateTime $date, $value);
|
20 |
|
21 |
/**
|
22 |
* When a CRON expression is not satisfied, this method is used to increment
|
27 |
*
|
28 |
* @return FieldInterface
|
29 |
*/
|
30 |
+
public function increment(DateTime $date, $invert = false);
|
31 |
|
32 |
/**
|
33 |
* Validates a CRON expression for a given field
|
vendor/mtdowling/cron-expression/src/Cron/HoursField.php
CHANGED
@@ -1,25 +1,28 @@
|
|
1 |
<?php
|
2 |
|
3 |
namespace Cron;
|
|
|
|
|
|
|
4 |
|
5 |
/**
|
6 |
* Hours field. Allows: * , / -
|
7 |
*/
|
8 |
class HoursField extends AbstractField
|
9 |
{
|
10 |
-
public function isSatisfiedBy(
|
11 |
{
|
12 |
return $this->isSatisfied($date->format('H'), $value);
|
13 |
}
|
14 |
|
15 |
-
public function increment(
|
16 |
{
|
17 |
// Change timezone to UTC temporarily. This will
|
18 |
// allow us to go back or forwards and hour even
|
19 |
// if DST will be changed between the hours.
|
20 |
if (is_null($parts) || $parts == '*') {
|
21 |
$timezone = $date->getTimezone();
|
22 |
-
$date->setTimezone(new
|
23 |
if ($invert) {
|
24 |
$date->modify('-1 hour');
|
25 |
} else {
|
1 |
<?php
|
2 |
|
3 |
namespace Cron;
|
4 |
+
use DateTime;
|
5 |
+
use DateTimeZone;
|
6 |
+
|
7 |
|
8 |
/**
|
9 |
* Hours field. Allows: * , / -
|
10 |
*/
|
11 |
class HoursField extends AbstractField
|
12 |
{
|
13 |
+
public function isSatisfiedBy(DateTime $date, $value)
|
14 |
{
|
15 |
return $this->isSatisfied($date->format('H'), $value);
|
16 |
}
|
17 |
|
18 |
+
public function increment(DateTime $date, $invert = false, $parts = null)
|
19 |
{
|
20 |
// Change timezone to UTC temporarily. This will
|
21 |
// allow us to go back or forwards and hour even
|
22 |
// if DST will be changed between the hours.
|
23 |
if (is_null($parts) || $parts == '*') {
|
24 |
$timezone = $date->getTimezone();
|
25 |
+
$date->setTimezone(new DateTimeZone('UTC'));
|
26 |
if ($invert) {
|
27 |
$date->modify('-1 hour');
|
28 |
} else {
|
vendor/mtdowling/cron-expression/src/Cron/MinutesField.php
CHANGED
@@ -2,17 +2,20 @@
|
|
2 |
|
3 |
namespace Cron;
|
4 |
|
|
|
|
|
|
|
5 |
/**
|
6 |
* Minutes field. Allows: * , / -
|
7 |
*/
|
8 |
class MinutesField extends AbstractField
|
9 |
{
|
10 |
-
public function isSatisfiedBy(
|
11 |
{
|
12 |
return $this->isSatisfied($date->format('i'), $value);
|
13 |
}
|
14 |
|
15 |
-
public function increment(
|
16 |
{
|
17 |
if (is_null($parts)) {
|
18 |
if ($invert) {
|
2 |
|
3 |
namespace Cron;
|
4 |
|
5 |
+
use DateTime;
|
6 |
+
|
7 |
+
|
8 |
/**
|
9 |
* Minutes field. Allows: * , / -
|
10 |
*/
|
11 |
class MinutesField extends AbstractField
|
12 |
{
|
13 |
+
public function isSatisfiedBy(DateTime $date, $value)
|
14 |
{
|
15 |
return $this->isSatisfied($date->format('i'), $value);
|
16 |
}
|
17 |
|
18 |
+
public function increment(DateTime $date, $invert = false, $parts = null)
|
19 |
{
|
20 |
if (is_null($parts)) {
|
21 |
if ($invert) {
|
vendor/mtdowling/cron-expression/src/Cron/YearField.php
CHANGED
@@ -2,17 +2,20 @@
|
|
2 |
|
3 |
namespace Cron;
|
4 |
|
|
|
|
|
|
|
5 |
/**
|
6 |
* Year field. Allows: * , / -
|
7 |
*/
|
8 |
class YearField extends AbstractField
|
9 |
{
|
10 |
-
public function isSatisfiedBy(
|
11 |
{
|
12 |
return $this->isSatisfied($date->format('Y'), $value);
|
13 |
}
|
14 |
|
15 |
-
public function increment(
|
16 |
{
|
17 |
if ($invert) {
|
18 |
$date->modify('-1 year');
|
2 |
|
3 |
namespace Cron;
|
4 |
|
5 |
+
use DateTime;
|
6 |
+
|
7 |
+
|
8 |
/**
|
9 |
* Year field. Allows: * , / -
|
10 |
*/
|
11 |
class YearField extends AbstractField
|
12 |
{
|
13 |
+
public function isSatisfiedBy(DateTime $date, $value)
|
14 |
{
|
15 |
return $this->isSatisfied($date->format('Y'), $value);
|
16 |
}
|
17 |
|
18 |
+
public function increment(DateTime $date, $invert = false)
|
19 |
{
|
20 |
if ($invert) {
|
21 |
$date->modify('-1 year');
|
vendor/nesbot/carbon/.php_cs.dist
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
use PhpCsFixer\Config;
|
4 |
+
use PhpCsFixer\Finder;
|
5 |
+
|
6 |
+
$rules = [
|
7 |
+
'@PSR2' => true,
|
8 |
+
'array_syntax' => [
|
9 |
+
'syntax' => 'long',
|
10 |
+
],
|
11 |
+
'binary_operator_spaces' => [
|
12 |
+
'align_double_arrow' => false,
|
13 |
+
'align_equals' => false,
|
14 |
+
],
|
15 |
+
'blank_line_before_return' => true,
|
16 |
+
'cast_spaces' => true,
|
17 |
+
'concat_space' => [
|
18 |
+
'spacing' => 'none',
|
19 |
+
],
|
20 |
+
'ereg_to_preg' => true,
|
21 |
+
'method_separation' => true,
|
22 |
+
'no_blank_lines_after_phpdoc' => true,
|
23 |
+
'no_extra_consecutive_blank_lines' => true,
|
24 |
+
'no_short_bool_cast' => true,
|
25 |
+
'no_unneeded_control_parentheses' => true,
|
26 |
+
'no_unused_imports' => true,
|
27 |
+
'no_whitespace_in_blank_line' => true,
|
28 |
+
'ordered_imports' => true,
|
29 |
+
'phpdoc_align' => true,
|
30 |
+
'phpdoc_indent' => true,
|
31 |
+
'phpdoc_inline_tag' => true,
|
32 |
+
'phpdoc_no_access' => true,
|
33 |
+
'phpdoc_no_alias_tag' => [
|
34 |
+
'type' => 'var',
|
35 |
+
],
|
36 |
+
'phpdoc_no_package' => true,
|
37 |
+
'phpdoc_order' => true,
|
38 |
+
'phpdoc_scalar' => true,
|
39 |
+
'phpdoc_separation' => true,
|
40 |
+
'phpdoc_to_comment' => true,
|
41 |
+
'phpdoc_trim' => true,
|
42 |
+
'phpdoc_types' => true,
|
43 |
+
'phpdoc_var_without_name' => true,
|
44 |
+
'self_accessor' => true,
|
45 |
+
'single_quote' => true,
|
46 |
+
'space_after_semicolon' => true,
|
47 |
+
'standardize_not_equals' => true,
|
48 |
+
'ternary_operator_spaces' => true,
|
49 |
+
'trailing_comma_in_multiline_array' => true,
|
50 |
+
'trim_array_spaces' => true,
|
51 |
+
'unary_operator_spaces' => true,
|
52 |
+
];
|
53 |
+
|
54 |
+
return Config::create()->setRules($rules)
|
55 |
+
->setFinder(Finder::create()->in(__DIR__))
|
56 |
+
->setUsingCache(true)
|
57 |
+
->setRiskyAllowed(true);
|
vendor/nesbot/carbon/composer.json
CHANGED
@@ -1,40 +1,54 @@
|
|
1 |
{
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
}
|
22 |
-
],
|
23 |
-
"require": {
|
24 |
-
"php": ">=5.3.0",
|
25 |
-
"symfony/translation": "~2.6|~3.0"
|
26 |
-
},
|
27 |
-
"require-dev": {
|
28 |
-
"phpunit/phpunit": "~4.0|~5.0"
|
29 |
-
},
|
30 |
-
"autoload": {
|
31 |
-
"psr-4": {
|
32 |
-
"Carbon\\": "src/Carbon/"
|
33 |
-
}
|
34 |
-
},
|
35 |
-
"autoload-dev": {
|
36 |
-
"psr-4": {
|
37 |
-
"Tests\\": "tests/"
|
38 |
-
}
|
39 |
-
}
|
40 |
}
|
1 |
{
|
2 |
+
"name": "nesbot/carbon",
|
3 |
+
"type": "library",
|
4 |
+
"description": "A simple API extension for DateTime.",
|
5 |
+
"keywords": [
|
6 |
+
"date",
|
7 |
+
"time",
|
8 |
+
"DateTime"
|
9 |
+
],
|
10 |
+
"homepage": "http://carbon.nesbot.com",
|
11 |
+
"support": {
|
12 |
+
"issues": "https://github.com/briannesbitt/Carbon/issues",
|
13 |
+
"source": "https://github.com/briannesbitt/Carbon"
|
14 |
+
},
|
15 |
+
"license": "MIT",
|
16 |
+
"authors": [
|
17 |
+
{
|
18 |
+
"name": "Brian Nesbitt",
|
19 |
+
"email": "brian@nesbot.com",
|
20 |
+
"homepage": "http://nesbot.com"
|
21 |
+
}
|
22 |
+
],
|
23 |
+
"require": {
|
24 |
+
"php": ">=5.3.0",
|
25 |
+
"symfony/translation": "~2.6 || ~3.0"
|
26 |
+
},
|
27 |
+
"require-dev": {
|
28 |
+
"friendsofphp/php-cs-fixer": "~2",
|
29 |
+
"phpunit/phpunit": "~4.0 || ~5.0"
|
30 |
+
},
|
31 |
+
"autoload": {
|
32 |
+
"psr-4": {
|
33 |
+
"Carbon\\": "src/Carbon/"
|
34 |
+
}
|
35 |
+
},
|
36 |
+
"autoload-dev": {
|
37 |
+
"psr-4": {
|
38 |
+
"Tests\\": "tests/"
|
39 |
+
}
|
40 |
+
},
|
41 |
+
"extra": {
|
42 |
+
"branch-alias": {
|
43 |
+
"dev-master": "1.23-dev"
|
44 |
+
}
|
45 |
+
},
|
46 |
+
"config": {
|
47 |
+
"sort-packages": true
|
48 |
+
},
|
49 |
+
"scripts": {
|
50 |
+
"test": "./vendor/bin/phpunit; ./vendor/bin/php-cs-fixer fix -v --diff --dry-run;",
|
51 |
+
"phpunit": "./vendor/bin/phpunit;",
|
52 |
+
"phpcs": "./vendor/bin/php-cs-fixer fix -v --diff --dry-run;"
|
53 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
}
|
vendor/nesbot/carbon/src/Carbon/Carbon.php
CHANGED
@@ -11,14 +11,15 @@
|
|
11 |
|
12 |
namespace Carbon;
|
13 |
|
|
|
14 |
use Closure;
|
|
|
15 |
use DateTime;
|
16 |
use DateTimeZone;
|
17 |
-
use DatePeriod;
|
18 |
use InvalidArgumentException;
|
|
|
19 |
use Symfony\Component\Translation\Translator;
|
20 |
use Symfony\Component\Translation\TranslatorInterface;
|
21 |
-
use Symfony\Component\Translation\Loader\ArrayLoader;
|
22 |
|
23 |
/**
|
24 |
* A simple API extension for DateTime
|
@@ -31,28 +32,28 @@ use Symfony\Component\Translation\Loader\ArrayLoader;
|
|
31 |
* @property int $minute
|
32 |
* @property int $second
|
33 |
* @property int $timestamp seconds since the Unix Epoch
|
34 |
-
* @property DateTimeZone $timezone the current timezone
|
35 |
-
* @property DateTimeZone $tz alias of timezone
|
36 |
-
* @property-read
|
37 |
-
* @property-read
|
38 |
-
* @property-read
|
39 |
-
* @property-read
|
40 |
-
* @property-read
|
41 |
-
* @property-read
|
42 |
-
* @property-read
|
43 |
-
* @property-read
|
44 |
-
* @property-read
|
45 |
-
* @property-read
|
46 |
-
* @property-read
|
47 |
-
* @property-read
|
48 |
-
* @property-read
|
49 |
-
* @property-read string
|
50 |
-
* @property-read string
|
51 |
*/
|
52 |
class Carbon extends DateTime
|
53 |
{
|
54 |
/**
|
55 |
-
* The day constants
|
56 |
*/
|
57 |
const SUNDAY = 0;
|
58 |
const MONDAY = 1;
|
@@ -78,29 +79,32 @@ class Carbon extends DateTime
|
|
78 |
);
|
79 |
|
80 |
/**
|
81 |
-
* Terms used to detect if a time passed is a relative date
|
|
|
|
|
82 |
*
|
83 |
* @var array
|
84 |
*/
|
85 |
protected static $relativeKeywords = array(
|
86 |
-
'this',
|
87 |
-
'next',
|
88 |
-
'last',
|
89 |
-
'tomorrow',
|
90 |
-
'yesterday',
|
91 |
'+',
|
92 |
'-',
|
|
|
93 |
'first',
|
94 |
'last',
|
95 |
-
'
|
|
|
|
|
|
|
|
|
96 |
);
|
97 |
|
98 |
/**
|
99 |
-
* Number of X in Y
|
100 |
*/
|
101 |
const YEARS_PER_CENTURY = 100;
|
102 |
const YEARS_PER_DECADE = 10;
|
103 |
const MONTHS_PER_YEAR = 12;
|
|
|
104 |
const WEEKS_PER_YEAR = 52;
|
105 |
const DAYS_PER_WEEK = 7;
|
106 |
const HOURS_PER_DAY = 24;
|
@@ -122,48 +126,104 @@ class Carbon extends DateTime
|
|
122 |
protected static $toStringFormat = self::DEFAULT_TO_STRING_FORMAT;
|
123 |
|
124 |
/**
|
125 |
-
* First day of week
|
126 |
*
|
127 |
* @var int
|
128 |
*/
|
129 |
protected static $weekStartsAt = self::MONDAY;
|
130 |
|
131 |
/**
|
132 |
-
* Last day of week
|
133 |
*
|
134 |
* @var int
|
135 |
*/
|
136 |
protected static $weekEndsAt = self::SUNDAY;
|
137 |
|
138 |
/**
|
139 |
-
* Days of weekend
|
140 |
*
|
141 |
* @var array
|
142 |
*/
|
143 |
-
protected static $weekendDays = array(
|
|
|
|
|
|
|
144 |
|
145 |
/**
|
146 |
-
* A test Carbon instance to be returned when now instances are created
|
147 |
*
|
148 |
-
* @var Carbon
|
149 |
*/
|
150 |
protected static $testNow;
|
151 |
|
152 |
/**
|
153 |
-
* A translator to ... er ... translate stuff
|
154 |
*
|
155 |
-
* @var TranslatorInterface
|
156 |
*/
|
157 |
protected static $translator;
|
158 |
|
159 |
/**
|
160 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
*
|
162 |
-
* @param DateTimeZone|string|null $object
|
163 |
*
|
164 |
-
* @throws InvalidArgumentException
|
165 |
*
|
166 |
-
* @return DateTimeZone
|
167 |
*/
|
168 |
protected static function safeCreateDateTimeZone($object)
|
169 |
{
|
@@ -176,6 +236,16 @@ class Carbon extends DateTime
|
|
176 |
return $object;
|
177 |
}
|
178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
$tz = @timezone_open((string) $object);
|
180 |
|
181 |
if ($tz === false) {
|
@@ -195,8 +265,8 @@ class Carbon extends DateTime
|
|
195 |
* Please see the testing aids section (specifically static::setTestNow())
|
196 |
* for more on the possibility of this constructor returning a test instance.
|
197 |
*
|
198 |
-
* @param string|null
|
199 |
-
* @param DateTimeZone|string|null $tz
|
200 |
*/
|
201 |
public function __construct($time = null, $tz = null)
|
202 |
{
|
@@ -209,10 +279,10 @@ class Carbon extends DateTime
|
|
209 |
}
|
210 |
|
211 |
//shift the time according to the given time zone
|
212 |
-
if ($tz !== null && $tz !== static::getTestNow()->
|
213 |
$testInstance->setTimezone($tz);
|
214 |
} else {
|
215 |
-
$tz = $testInstance->
|
216 |
}
|
217 |
|
218 |
$time = $testInstance->toDateTimeString();
|
@@ -222,25 +292,30 @@ class Carbon extends DateTime
|
|
222 |
}
|
223 |
|
224 |
/**
|
225 |
-
* Create a Carbon instance from a DateTime one
|
226 |
*
|
227 |
-
* @param DateTime $dt
|
228 |
*
|
229 |
* @return static
|
230 |
*/
|
231 |
public static function instance(DateTime $dt)
|
232 |
{
|
233 |
-
|
|
|
|
|
|
|
|
|
234 |
}
|
235 |
|
236 |
/**
|
237 |
-
* Create a carbon instance from a string.
|
238 |
-
* constructor that allows better fluent syntax as it allows you to do
|
239 |
-
* Carbon::parse('Monday next week')->fn() rather than
|
240 |
-
* (new Carbon('Monday next week'))->fn()
|
241 |
*
|
242 |
-
*
|
243 |
-
*
|
|
|
|
|
|
|
|
|
244 |
*
|
245 |
* @return static
|
246 |
*/
|
@@ -250,9 +325,9 @@ class Carbon extends DateTime
|
|
250 |
}
|
251 |
|
252 |
/**
|
253 |
-
* Get a Carbon instance for the current date and time
|
254 |
*
|
255 |
-
* @param DateTimeZone|string|null $tz
|
256 |
*
|
257 |
* @return static
|
258 |
*/
|
@@ -262,9 +337,9 @@ class Carbon extends DateTime
|
|
262 |
}
|
263 |
|
264 |
/**
|
265 |
-
* Create a Carbon instance for today
|
266 |
*
|
267 |
-
* @param DateTimeZone|string|null $tz
|
268 |
*
|
269 |
* @return static
|
270 |
*/
|
@@ -274,9 +349,9 @@ class Carbon extends DateTime
|
|
274 |
}
|
275 |
|
276 |
/**
|
277 |
-
* Create a Carbon instance for tomorrow
|
278 |
*
|
279 |
-
* @param DateTimeZone|string|null $tz
|
280 |
*
|
281 |
* @return static
|
282 |
*/
|
@@ -286,9 +361,9 @@ class Carbon extends DateTime
|
|
286 |
}
|
287 |
|
288 |
/**
|
289 |
-
* Create a Carbon instance for yesterday
|
290 |
*
|
291 |
-
* @param DateTimeZone|string|null $tz
|
292 |
*
|
293 |
* @return static
|
294 |
*/
|
@@ -300,7 +375,7 @@ class Carbon extends DateTime
|
|
300 |
/**
|
301 |
* Create a Carbon instance for the greatest supported date.
|
302 |
*
|
303 |
-
* @return
|
304 |
*/
|
305 |
public static function maxValue()
|
306 |
{
|
@@ -316,7 +391,7 @@ class Carbon extends DateTime
|
|
316 |
/**
|
317 |
* Create a Carbon instance for the lowest supported date.
|
318 |
*
|
319 |
-
* @return
|
320 |
*/
|
321 |
public static function minValue()
|
322 |
{
|
@@ -332,49 +407,130 @@ class Carbon extends DateTime
|
|
332 |
/**
|
333 |
* Create a new Carbon instance from a specific date and time.
|
334 |
*
|
335 |
-
* If any of $year, $month or $day are set to null their now() values
|
336 |
-
*
|
|
|
|
|
|
|
337 |
*
|
338 |
-
* If $hour is null it will be set to its now() value and the default values
|
339 |
-
* for $minute and $second will be their now() values.
|
340 |
* If $hour is not null then the default values for $minute and $second
|
341 |
* will be 0.
|
342 |
*
|
343 |
-
* @param int|null
|
344 |
-
* @param int|null
|
345 |
-
* @param int|null
|
346 |
-
* @param int|null
|
347 |
-
* @param int|null
|
348 |
-
* @param int|null
|
349 |
-
* @param DateTimeZone|string|null $tz
|
350 |
*
|
351 |
* @return static
|
352 |
*/
|
353 |
public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
|
354 |
{
|
355 |
-
$
|
356 |
-
|
357 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
358 |
|
359 |
if ($hour === null) {
|
360 |
-
$hour =
|
361 |
-
$minute = $minute === null ?
|
362 |
-
$second = $second === null ?
|
363 |
} else {
|
364 |
$minute = $minute === null ? 0 : $minute;
|
365 |
$second = $second === null ? 0 : $second;
|
366 |
}
|
367 |
|
368 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
}
|
370 |
|
371 |
/**
|
372 |
* Create a Carbon instance from just a date. The time portion is set to now.
|
373 |
*
|
374 |
-
* @param int|null
|
375 |
-
* @param int|null
|
376 |
-
* @param int|null
|
377 |
-
* @param DateTimeZone|string|null $tz
|
378 |
*
|
379 |
* @return static
|
380 |
*/
|
@@ -386,10 +542,10 @@ class Carbon extends DateTime
|
|
386 |
/**
|
387 |
* Create a Carbon instance from just a time. The date portion is set to today.
|
388 |
*
|
389 |
-
* @param int|null
|
390 |
-
* @param int|null
|
391 |
-
* @param int|null
|
392 |
-
* @param DateTimeZone|string|null $tz
|
393 |
*
|
394 |
* @return static
|
395 |
*/
|
@@ -399,13 +555,13 @@ class Carbon extends DateTime
|
|
399 |
}
|
400 |
|
401 |
/**
|
402 |
-
* Create a Carbon instance from a specific format
|
403 |
*
|
404 |
-
* @param string
|
405 |
-
* @param string
|
406 |
-
* @param DateTimeZone|string|null $tz
|
407 |
*
|
408 |
-
* @throws InvalidArgumentException
|
409 |
*
|
410 |
* @return static
|
411 |
*/
|
@@ -417,19 +573,40 @@ class Carbon extends DateTime
|
|
417 |
$dt = parent::createFromFormat($format, $time);
|
418 |
}
|
419 |
|
|
|
|
|
420 |
if ($dt instanceof DateTime) {
|
421 |
return static::instance($dt);
|
422 |
}
|
423 |
|
424 |
-
|
425 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
}
|
427 |
|
428 |
/**
|
429 |
-
* Create a Carbon instance from a timestamp
|
430 |
*
|
431 |
-
* @param int
|
432 |
-
* @param DateTimeZone|string|null $tz
|
433 |
*
|
434 |
* @return static
|
435 |
*/
|
@@ -439,7 +616,7 @@ class Carbon extends DateTime
|
|
439 |
}
|
440 |
|
441 |
/**
|
442 |
-
* Create a Carbon instance from an UTC timestamp
|
443 |
*
|
444 |
* @param int $timestamp
|
445 |
*
|
@@ -451,13 +628,13 @@ class Carbon extends DateTime
|
|
451 |
}
|
452 |
|
453 |
/**
|
454 |
-
* Get a copy of the instance
|
455 |
*
|
456 |
* @return static
|
457 |
*/
|
458 |
public function copy()
|
459 |
{
|
460 |
-
return
|
461 |
}
|
462 |
|
463 |
///////////////////////////////////////////////////////////////////
|
@@ -469,9 +646,9 @@ class Carbon extends DateTime
|
|
469 |
*
|
470 |
* @param string $name
|
471 |
*
|
472 |
-
* @throws InvalidArgumentException
|
473 |
*
|
474 |
-
* @return string|int
|
475 |
*/
|
476 |
public function __get($name)
|
477 |
{
|
@@ -497,10 +674,10 @@ class Carbon extends DateTime
|
|
497 |
return (int) ceil($this->day / static::DAYS_PER_WEEK);
|
498 |
|
499 |
case $name === 'age':
|
500 |
-
return
|
501 |
|
502 |
case $name === 'quarter':
|
503 |
-
return (int) ceil($this->month /
|
504 |
|
505 |
case $name === 'offset':
|
506 |
return $this->getOffset();
|
@@ -512,10 +689,10 @@ class Carbon extends DateTime
|
|
512 |
return $this->format('I') === '1';
|
513 |
|
514 |
case $name === 'local':
|
515 |
-
return $this->
|
516 |
|
517 |
case $name === 'utc':
|
518 |
-
return $this->
|
519 |
|
520 |
case $name === 'timezone' || $name === 'tz':
|
521 |
return $this->getTimezone();
|
@@ -549,36 +726,23 @@ class Carbon extends DateTime
|
|
549 |
/**
|
550 |
* Set a part of the Carbon object
|
551 |
*
|
552 |
-
* @param string
|
553 |
-
* @param string|int
|
554 |
*
|
555 |
-
* @throws InvalidArgumentException
|
556 |
*/
|
557 |
public function __set($name, $value)
|
558 |
{
|
559 |
switch ($name) {
|
560 |
case 'year':
|
561 |
-
$this->setDate($value, $this->month, $this->day);
|
562 |
-
break;
|
563 |
-
|
564 |
case 'month':
|
565 |
-
$this->setDate($this->year, $value, $this->day);
|
566 |
-
break;
|
567 |
-
|
568 |
case 'day':
|
569 |
-
$this->setDate($this->year, $this->month, $value);
|
570 |
-
break;
|
571 |
-
|
572 |
case 'hour':
|
573 |
-
$this->setTime($value, $this->minute, $this->second);
|
574 |
-
break;
|
575 |
-
|
576 |
case 'minute':
|
577 |
-
$this->setTime($this->hour, $value, $this->second);
|
578 |
-
break;
|
579 |
-
|
580 |
case 'second':
|
581 |
-
|
|
|
|
|
582 |
break;
|
583 |
|
584 |
case 'timestamp':
|
@@ -679,6 +843,26 @@ class Carbon extends DateTime
|
|
679 |
return $this;
|
680 |
}
|
681 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
682 |
/**
|
683 |
* Set the date and time all together
|
684 |
*
|
@@ -705,7 +889,7 @@ class Carbon extends DateTime
|
|
705 |
*/
|
706 |
public function setTimeFromTimeString($time)
|
707 |
{
|
708 |
-
$time = explode(
|
709 |
|
710 |
$hour = $time[0];
|
711 |
$minute = isset($time[1]) ? $time[1] : 0;
|
@@ -723,15 +907,13 @@ class Carbon extends DateTime
|
|
723 |
*/
|
724 |
public function timestamp($value)
|
725 |
{
|
726 |
-
$this->
|
727 |
-
|
728 |
-
return $this;
|
729 |
}
|
730 |
|
731 |
/**
|
732 |
* Alias for setTimezone()
|
733 |
*
|
734 |
-
* @param DateTimeZone|string $value
|
735 |
*
|
736 |
* @return static
|
737 |
*/
|
@@ -743,7 +925,7 @@ class Carbon extends DateTime
|
|
743 |
/**
|
744 |
* Alias for setTimezone()
|
745 |
*
|
746 |
-
* @param DateTimeZone|string $value
|
747 |
*
|
748 |
* @return static
|
749 |
*/
|
@@ -755,15 +937,13 @@ class Carbon extends DateTime
|
|
755 |
/**
|
756 |
* Set the instance's timezone from a string or object
|
757 |
*
|
758 |
-
* @param DateTimeZone|string $value
|
759 |
*
|
760 |
* @return static
|
761 |
*/
|
762 |
public function setTimezone($value)
|
763 |
{
|
764 |
-
parent::setTimezone(static::safeCreateDateTimeZone($value));
|
765 |
-
|
766 |
-
return $this;
|
767 |
}
|
768 |
|
769 |
///////////////////////////////////////////////////////////////////
|
@@ -801,7 +981,7 @@ class Carbon extends DateTime
|
|
801 |
}
|
802 |
|
803 |
/**
|
804 |
-
* Set the
|
805 |
*
|
806 |
* @param int
|
807 |
*/
|
@@ -841,6 +1021,7 @@ class Carbon extends DateTime
|
|
841 |
* - A call to the static now() method, ex. Carbon::now()
|
842 |
* - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null)
|
843 |
* - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now')
|
|
|
844 |
*
|
845 |
* Note the timezone parameter was left out of the examples above and
|
846 |
* has no affect as the mock value will be returned regardless of its value.
|
@@ -848,11 +1029,11 @@ class Carbon extends DateTime
|
|
848 |
* To clear the test instance call this method using the default
|
849 |
* parameter of null.
|
850 |
*
|
851 |
-
* @param Carbon|null $testNow
|
852 |
*/
|
853 |
-
public static function setTestNow(
|
854 |
{
|
855 |
-
static::$testNow = $testNow;
|
856 |
}
|
857 |
|
858 |
/**
|
@@ -888,7 +1069,7 @@ class Carbon extends DateTime
|
|
888 |
public static function hasRelativeKeywords($time)
|
889 |
{
|
890 |
// skip common format with a '-' in it
|
891 |
-
if (preg_match('
|
892 |
foreach (static::$relativeKeywords as $keyword) {
|
893 |
if (stripos($time, $keyword) !== false) {
|
894 |
return true;
|
@@ -904,9 +1085,9 @@ class Carbon extends DateTime
|
|
904 |
///////////////////////////////////////////////////////////////////
|
905 |
|
906 |
/**
|
907 |
-
*
|
908 |
*
|
909 |
-
* @return TranslatorInterface
|
910 |
*/
|
911 |
protected static function translator()
|
912 |
{
|
@@ -922,7 +1103,7 @@ class Carbon extends DateTime
|
|
922 |
/**
|
923 |
* Get the translator instance in use
|
924 |
*
|
925 |
-
* @return TranslatorInterface
|
926 |
*/
|
927 |
public static function getTranslator()
|
928 |
{
|
@@ -932,7 +1113,7 @@ class Carbon extends DateTime
|
|
932 |
/**
|
933 |
* Set the translator instance to use
|
934 |
*
|
935 |
-
* @param TranslatorInterface $translator
|
936 |
*/
|
937 |
public static function setTranslator(TranslatorInterface $translator)
|
938 |
{
|
@@ -950,22 +1131,43 @@ class Carbon extends DateTime
|
|
950 |
}
|
951 |
|
952 |
/**
|
953 |
-
* Set the current translator locale
|
954 |
*
|
955 |
* @param string $locale
|
|
|
|
|
956 |
*/
|
957 |
public static function setLocale($locale)
|
958 |
{
|
959 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
960 |
|
961 |
-
|
962 |
-
static::translator()->addResource('array', require __DIR__.'/Lang/'.$locale.'.php', $locale);
|
963 |
}
|
964 |
|
965 |
///////////////////////////////////////////////////////////////////
|
966 |
/////////////////////// STRING FORMATTING /////////////////////////
|
967 |
///////////////////////////////////////////////////////////////////
|
968 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
969 |
/**
|
970 |
* Format the instance with the current locale. You can set the current
|
971 |
* locale using setlocale() http://php.net/setlocale.
|
@@ -982,7 +1184,9 @@ class Carbon extends DateTime
|
|
982 |
$format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format);
|
983 |
}
|
984 |
|
985 |
-
|
|
|
|
|
986 |
}
|
987 |
|
988 |
/**
|
@@ -1090,7 +1294,7 @@ class Carbon extends DateTime
|
|
1090 |
*/
|
1091 |
public function toIso8601String()
|
1092 |
{
|
1093 |
-
return $this->
|
1094 |
}
|
1095 |
|
1096 |
/**
|
@@ -1189,6 +1393,20 @@ class Carbon extends DateTime
|
|
1189 |
return $this == $dt;
|
1190 |
}
|
1191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1192 |
/**
|
1193 |
* Determines if the instance is not equal to another
|
1194 |
*
|
@@ -1201,6 +1419,20 @@ class Carbon extends DateTime
|
|
1201 |
return !$this->eq($dt);
|
1202 |
}
|
1203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1204 |
/**
|
1205 |
* Determines if the instance is greater (after) than another
|
1206 |
*
|
@@ -1213,6 +1445,20 @@ class Carbon extends DateTime
|
|
1213 |
return $this > $dt;
|
1214 |
}
|
1215 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1216 |
/**
|
1217 |
* Determines if the instance is greater (after) than or equal to another
|
1218 |
*
|
@@ -1225,6 +1471,20 @@ class Carbon extends DateTime
|
|
1225 |
return $this >= $dt;
|
1226 |
}
|
1227 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1228 |
/**
|
1229 |
* Determines if the instance is less (before) than another
|
1230 |
*
|
@@ -1237,6 +1497,20 @@ class Carbon extends DateTime
|
|
1237 |
return $this < $dt;
|
1238 |
}
|
1239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1240 |
/**
|
1241 |
* Determines if the instance is less (before) or equal to another
|
1242 |
*
|
@@ -1249,6 +1523,20 @@ class Carbon extends DateTime
|
|
1249 |
return $this <= $dt;
|
1250 |
}
|
1251 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1252 |
/**
|
1253 |
* Determines if the instance is between two others
|
1254 |
*
|
@@ -1302,31 +1590,59 @@ class Carbon extends DateTime
|
|
1302 |
/**
|
1303 |
* Get the minimum instance between a given instance (default now) and the current instance.
|
1304 |
*
|
1305 |
-
* @param Carbon|null $dt
|
1306 |
*
|
1307 |
* @return static
|
1308 |
*/
|
1309 |
public function min(Carbon $dt = null)
|
1310 |
{
|
1311 |
-
$dt = $dt ?: static::now($this->
|
1312 |
|
1313 |
return $this->lt($dt) ? $this : $dt;
|
1314 |
}
|
1315 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1316 |
/**
|
1317 |
* Get the maximum instance between a given instance (default now) and the current instance.
|
1318 |
*
|
1319 |
-
* @param Carbon|null $dt
|
1320 |
*
|
1321 |
* @return static
|
1322 |
*/
|
1323 |
public function max(Carbon $dt = null)
|
1324 |
{
|
1325 |
-
$dt = $dt ?: static::now($this->
|
1326 |
|
1327 |
return $this->gt($dt) ? $this : $dt;
|
1328 |
}
|
1329 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1330 |
/**
|
1331 |
* Determines if the instance is a weekday
|
1332 |
*
|
@@ -1344,7 +1660,7 @@ class Carbon extends DateTime
|
|
1344 |
*/
|
1345 |
public function isWeekend()
|
1346 |
{
|
1347 |
-
return in_array($this->dayOfWeek,
|
1348 |
}
|
1349 |
|
1350 |
/**
|
@@ -1354,7 +1670,7 @@ class Carbon extends DateTime
|
|
1354 |
*/
|
1355 |
public function isYesterday()
|
1356 |
{
|
1357 |
-
return $this->toDateString() === static::yesterday($this->
|
1358 |
}
|
1359 |
|
1360 |
/**
|
@@ -1364,7 +1680,7 @@ class Carbon extends DateTime
|
|
1364 |
*/
|
1365 |
public function isToday()
|
1366 |
{
|
1367 |
-
return $this->toDateString() === static::now($this->
|
1368 |
}
|
1369 |
|
1370 |
/**
|
@@ -1374,83 +1690,217 @@ class Carbon extends DateTime
|
|
1374 |
*/
|
1375 |
public function isTomorrow()
|
1376 |
{
|
1377 |
-
return $this->toDateString() === static::tomorrow($this->
|
1378 |
}
|
1379 |
|
1380 |
/**
|
1381 |
-
* Determines if the instance is
|
1382 |
*
|
1383 |
* @return bool
|
1384 |
*/
|
1385 |
-
public function
|
1386 |
{
|
1387 |
-
return $this->
|
1388 |
}
|
1389 |
|
1390 |
/**
|
1391 |
-
* Determines if the instance is
|
1392 |
*
|
1393 |
* @return bool
|
1394 |
*/
|
1395 |
-
public function
|
1396 |
{
|
1397 |
-
return $this->
|
1398 |
}
|
1399 |
|
1400 |
/**
|
1401 |
-
* Determines if the instance is
|
1402 |
*
|
1403 |
* @return bool
|
1404 |
*/
|
1405 |
-
public function
|
1406 |
{
|
1407 |
-
return $this->
|
1408 |
}
|
1409 |
|
1410 |
/**
|
1411 |
-
*
|
1412 |
-
*
|
1413 |
-
* @param Carbon $dt
|
1414 |
*
|
1415 |
* @return bool
|
1416 |
*/
|
1417 |
-
public function
|
1418 |
{
|
1419 |
-
return $this->
|
1420 |
}
|
1421 |
|
1422 |
/**
|
1423 |
-
*
|
1424 |
*
|
1425 |
* @return bool
|
1426 |
*/
|
1427 |
-
public function
|
1428 |
{
|
1429 |
-
return $this->
|
1430 |
}
|
1431 |
|
1432 |
/**
|
1433 |
-
*
|
1434 |
*
|
1435 |
* @return bool
|
1436 |
*/
|
1437 |
-
public function
|
1438 |
{
|
1439 |
-
return $this->
|
1440 |
}
|
1441 |
|
1442 |
/**
|
1443 |
-
*
|
1444 |
*
|
1445 |
* @return bool
|
1446 |
*/
|
1447 |
-
public function
|
1448 |
{
|
1449 |
-
return $this->
|
1450 |
}
|
1451 |
|
1452 |
/**
|
1453 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1454 |
*
|
1455 |
* @return bool
|
1456 |
*/
|
@@ -1542,6 +1992,104 @@ class Carbon extends DateTime
|
|
1542 |
return $this->addYears(-1 * $value);
|
1543 |
}
|
1544 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1545 |
/**
|
1546 |
* Add months to the instance. Positive $value travels forward while
|
1547 |
* negative $value travels into the past.
|
@@ -1552,7 +2100,11 @@ class Carbon extends DateTime
|
|
1552 |
*/
|
1553 |
public function addMonths($value)
|
1554 |
{
|
1555 |
-
|
|
|
|
|
|
|
|
|
1556 |
}
|
1557 |
|
1558 |
/**
|
@@ -1591,6 +2143,55 @@ class Carbon extends DateTime
|
|
1591 |
return $this->addMonths(-1 * $value);
|
1592 |
}
|
1593 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1594 |
/**
|
1595 |
* Add months without overflowing to the instance. Positive $value
|
1596 |
* travels forward while negative $value travels into the past.
|
@@ -1601,13 +2202,15 @@ class Carbon extends DateTime
|
|
1601 |
*/
|
1602 |
public function addMonthsNoOverflow($value)
|
1603 |
{
|
1604 |
-
$
|
1605 |
|
1606 |
-
|
1607 |
-
|
|
|
|
|
1608 |
}
|
1609 |
|
1610 |
-
return $
|
1611 |
}
|
1612 |
|
1613 |
/**
|
@@ -1705,7 +2308,11 @@ class Carbon extends DateTime
|
|
1705 |
*/
|
1706 |
public function addWeekdays($value)
|
1707 |
{
|
1708 |
-
|
|
|
|
|
|
|
|
|
1709 |
}
|
1710 |
|
1711 |
/**
|
@@ -1947,14 +2554,14 @@ class Carbon extends DateTime
|
|
1947 |
/**
|
1948 |
* Get the difference in years
|
1949 |
*
|
1950 |
-
* @param Carbon|null $dt
|
1951 |
-
* @param bool
|
1952 |
*
|
1953 |
* @return int
|
1954 |
*/
|
1955 |
public function diffInYears(Carbon $dt = null, $abs = true)
|
1956 |
{
|
1957 |
-
$dt = $dt ?: static::now($this->
|
1958 |
|
1959 |
return (int) $this->diff($dt, $abs)->format('%r%y');
|
1960 |
}
|
@@ -1962,14 +2569,14 @@ class Carbon extends DateTime
|
|
1962 |
/**
|
1963 |
* Get the difference in months
|
1964 |
*
|
1965 |
-
* @param Carbon|null $dt
|
1966 |
-
* @param bool
|
1967 |
*
|
1968 |
* @return int
|
1969 |
*/
|
1970 |
public function diffInMonths(Carbon $dt = null, $abs = true)
|
1971 |
{
|
1972 |
-
$dt = $dt ?: static::now($this->
|
1973 |
|
1974 |
return $this->diffInYears($dt, $abs) * static::MONTHS_PER_YEAR + (int) $this->diff($dt, $abs)->format('%r%m');
|
1975 |
}
|
@@ -1977,8 +2584,8 @@ class Carbon extends DateTime
|
|
1977 |
/**
|
1978 |
* Get the difference in weeks
|
1979 |
*
|
1980 |
-
* @param Carbon|null $dt
|
1981 |
-
* @param bool
|
1982 |
*
|
1983 |
* @return int
|
1984 |
*/
|
@@ -1990,14 +2597,14 @@ class Carbon extends DateTime
|
|
1990 |
/**
|
1991 |
* Get the difference in days
|
1992 |
*
|
1993 |
-
* @param Carbon|null $dt
|
1994 |
-
* @param bool
|
1995 |
*
|
1996 |
* @return int
|
1997 |
*/
|
1998 |
public function diffInDays(Carbon $dt = null, $abs = true)
|
1999 |
{
|
2000 |
-
$dt = $dt ?: static::now($this->
|
2001 |
|
2002 |
return (int) $this->diff($dt, $abs)->format('%r%a');
|
2003 |
}
|
@@ -2005,9 +2612,9 @@ class Carbon extends DateTime
|
|
2005 |
/**
|
2006 |
* Get the difference in days using a filter closure
|
2007 |
*
|
2008 |
-
* @param Closure
|
2009 |
-
* @param Carbon|null $dt
|
2010 |
-
* @param bool
|
2011 |
*
|
2012 |
* @return int
|
2013 |
*/
|
@@ -2019,9 +2626,9 @@ class Carbon extends DateTime
|
|
2019 |
/**
|
2020 |
* Get the difference in hours using a filter closure
|
2021 |
*
|
2022 |
-
* @param Closure
|
2023 |
-
* @param Carbon|null $dt
|
2024 |
-
* @param bool
|
2025 |
*
|
2026 |
* @return int
|
2027 |
*/
|
@@ -2043,7 +2650,7 @@ class Carbon extends DateTime
|
|
2043 |
public function diffFiltered(CarbonInterval $ci, Closure $callback, Carbon $dt = null, $abs = true)
|
2044 |
{
|
2045 |
$start = $this;
|
2046 |
-
$end = $dt ?: static::now($this->
|
2047 |
$inverse = false;
|
2048 |
|
2049 |
if ($end < $start) {
|
@@ -2065,8 +2672,8 @@ class Carbon extends DateTime
|
|
2065 |
/**
|
2066 |
* Get the difference in weekdays
|
2067 |
*
|
2068 |
-
* @param Carbon|null $dt
|
2069 |
-
* @param bool
|
2070 |
*
|
2071 |
* @return int
|
2072 |
*/
|
@@ -2080,8 +2687,8 @@ class Carbon extends DateTime
|
|
2080 |
/**
|
2081 |
* Get the difference in weekend days using a filter
|
2082 |
*
|
2083 |
-
* @param Carbon|null $dt
|
2084 |
-
* @param bool
|
2085 |
*
|
2086 |
* @return int
|
2087 |
*/
|
@@ -2095,8 +2702,8 @@ class Carbon extends DateTime
|
|
2095 |
/**
|
2096 |
* Get the difference in hours
|
2097 |
*
|
2098 |
-
* @param Carbon|null $dt
|
2099 |
-
* @param bool
|
2100 |
*
|
2101 |
* @return int
|
2102 |
*/
|
@@ -2108,8 +2715,8 @@ class Carbon extends DateTime
|
|
2108 |
/**
|
2109 |
* Get the difference in minutes
|
2110 |
*
|
2111 |
-
* @param Carbon|null $dt
|
2112 |
-
* @param bool
|
2113 |
*
|
2114 |
* @return int
|
2115 |
*/
|
@@ -2121,14 +2728,14 @@ class Carbon extends DateTime
|
|
2121 |
/**
|
2122 |
* Get the difference in seconds
|
2123 |
*
|
2124 |
-
* @param Carbon|null $dt
|
2125 |
-
* @param bool
|
2126 |
*
|
2127 |
* @return int
|
2128 |
*/
|
2129 |
public function diffInSeconds(Carbon $dt = null, $abs = true)
|
2130 |
{
|
2131 |
-
$dt = $dt ?: static::now($this->
|
2132 |
$value = $dt->getTimestamp() - $this->getTimestamp();
|
2133 |
|
2134 |
return $abs ? abs($value) : $value;
|
@@ -2175,52 +2782,54 @@ class Carbon extends DateTime
|
|
2175 |
*
|
2176 |
* @param Carbon|null $other
|
2177 |
* @param bool $absolute removes time difference modifiers ago, after, etc
|
|
|
2178 |
*
|
2179 |
* @return string
|
2180 |
*/
|
2181 |
-
public function diffForHumans(Carbon $other = null, $absolute = false)
|
2182 |
{
|
2183 |
$isNow = $other === null;
|
2184 |
|
2185 |
if ($isNow) {
|
2186 |
-
$other = static::now($this->
|
2187 |
}
|
2188 |
|
2189 |
$diffInterval = $this->diff($other);
|
2190 |
|
2191 |
switch (true) {
|
2192 |
-
case
|
2193 |
-
$unit = 'year';
|
2194 |
$count = $diffInterval->y;
|
2195 |
break;
|
2196 |
|
2197 |
-
case
|
2198 |
-
$unit = 'month';
|
2199 |
$count = $diffInterval->m;
|
2200 |
break;
|
2201 |
|
2202 |
-
case
|
2203 |
-
$unit = 'day';
|
2204 |
$count = $diffInterval->d;
|
2205 |
-
|
2206 |
-
|
2207 |
-
$
|
|
|
2208 |
}
|
2209 |
break;
|
2210 |
|
2211 |
-
case
|
2212 |
-
$unit = 'hour';
|
2213 |
$count = $diffInterval->h;
|
2214 |
break;
|
2215 |
|
2216 |
-
case
|
2217 |
-
$unit = 'minute';
|
2218 |
$count = $diffInterval->i;
|
2219 |
break;
|
2220 |
|
2221 |
default:
|
2222 |
$count = $diffInterval->s;
|
2223 |
-
$unit = 'second';
|
2224 |
break;
|
2225 |
}
|
2226 |
|
@@ -2258,7 +2867,7 @@ class Carbon extends DateTime
|
|
2258 |
*/
|
2259 |
public function startOfDay()
|
2260 |
{
|
2261 |
-
return $this->
|
2262 |
}
|
2263 |
|
2264 |
/**
|
@@ -2268,7 +2877,7 @@ class Carbon extends DateTime
|
|
2268 |
*/
|
2269 |
public function endOfDay()
|
2270 |
{
|
2271 |
-
return $this->
|
2272 |
}
|
2273 |
|
2274 |
/**
|
@@ -2278,7 +2887,7 @@ class Carbon extends DateTime
|
|
2278 |
*/
|
2279 |
public function startOfMonth()
|
2280 |
{
|
2281 |
-
return $this->
|
2282 |
}
|
2283 |
|
2284 |
/**
|
@@ -2288,7 +2897,29 @@ class Carbon extends DateTime
|
|
2288 |
*/
|
2289 |
public function endOfMonth()
|
2290 |
{
|
2291 |
-
return $this->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2292 |
}
|
2293 |
|
2294 |
/**
|
@@ -2298,7 +2929,7 @@ class Carbon extends DateTime
|
|
2298 |
*/
|
2299 |
public function startOfYear()
|
2300 |
{
|
2301 |
-
return $this->
|
2302 |
}
|
2303 |
|
2304 |
/**
|
@@ -2308,7 +2939,7 @@ class Carbon extends DateTime
|
|
2308 |
*/
|
2309 |
public function endOfYear()
|
2310 |
{
|
2311 |
-
return $this->
|
2312 |
}
|
2313 |
|
2314 |
/**
|
@@ -2318,7 +2949,9 @@ class Carbon extends DateTime
|
|
2318 |
*/
|
2319 |
public function startOfDecade()
|
2320 |
{
|
2321 |
-
|
|
|
|
|
2322 |
}
|
2323 |
|
2324 |
/**
|
@@ -2328,7 +2961,9 @@ class Carbon extends DateTime
|
|
2328 |
*/
|
2329 |
public function endOfDecade()
|
2330 |
{
|
2331 |
-
|
|
|
|
|
2332 |
}
|
2333 |
|
2334 |
/**
|
@@ -2338,7 +2973,9 @@ class Carbon extends DateTime
|
|
2338 |
*/
|
2339 |
public function startOfCentury()
|
2340 |
{
|
2341 |
-
|
|
|
|
|
2342 |
}
|
2343 |
|
2344 |
/**
|
@@ -2348,7 +2985,9 @@ class Carbon extends DateTime
|
|
2348 |
*/
|
2349 |
public function endOfCentury()
|
2350 |
{
|
2351 |
-
|
|
|
|
|
2352 |
}
|
2353 |
|
2354 |
/**
|
@@ -2358,8 +2997,8 @@ class Carbon extends DateTime
|
|
2358 |
*/
|
2359 |
public function startOfWeek()
|
2360 |
{
|
2361 |
-
|
2362 |
-
$this->
|
2363 |
}
|
2364 |
|
2365 |
return $this->startOfDay();
|
@@ -2372,8 +3011,8 @@ class Carbon extends DateTime
|
|
2372 |
*/
|
2373 |
public function endOfWeek()
|
2374 |
{
|
2375 |
-
|
2376 |
-
$this->
|
2377 |
}
|
2378 |
|
2379 |
return $this->endOfDay();
|
@@ -2382,7 +3021,7 @@ class Carbon extends DateTime
|
|
2382 |
/**
|
2383 |
* Modify to the next occurrence of a given day of the week.
|
2384 |
* If no dayOfWeek is provided, modify to the next occurrence
|
2385 |
-
* of the current day of the week. Use the supplied
|
2386 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
2387 |
*
|
2388 |
* @param int|null $dayOfWeek
|
@@ -2398,10 +3037,69 @@ class Carbon extends DateTime
|
|
2398 |
return $this->startOfDay()->modify('next '.static::$days[$dayOfWeek]);
|
2399 |
}
|
2400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2401 |
/**
|
2402 |
* Modify to the previous occurrence of a given day of the week.
|
2403 |
* If no dayOfWeek is provided, modify to the previous occurrence
|
2404 |
-
* of the current day of the week. Use the supplied
|
2405 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
2406 |
*
|
2407 |
* @param int|null $dayOfWeek
|
@@ -2420,7 +3118,7 @@ class Carbon extends DateTime
|
|
2420 |
/**
|
2421 |
* Modify to the first occurrence of a given day of the week
|
2422 |
* in the current month. If no dayOfWeek is provided, modify to the
|
2423 |
-
* first day of the current month. Use the supplied
|
2424 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
2425 |
*
|
2426 |
* @param int|null $dayOfWeek
|
@@ -2441,7 +3139,7 @@ class Carbon extends DateTime
|
|
2441 |
/**
|
2442 |
* Modify to the last occurrence of a given day of the week
|
2443 |
* in the current month. If no dayOfWeek is provided, modify to the
|
2444 |
-
* last day of the current month. Use the supplied
|
2445 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
2446 |
*
|
2447 |
* @param int|null $dayOfWeek
|
@@ -2463,7 +3161,7 @@ class Carbon extends DateTime
|
|
2463 |
* Modify to the given occurrence of a given day of the week
|
2464 |
* in the current month. If the calculated occurrence is outside the scope
|
2465 |
* of the current month, then return false and no modifications are made.
|
2466 |
-
* Use the supplied
|
2467 |
*
|
2468 |
* @param int $nth
|
2469 |
* @param int $dayOfWeek
|
@@ -2482,7 +3180,7 @@ class Carbon extends DateTime
|
|
2482 |
/**
|
2483 |
* Modify to the first occurrence of a given day of the week
|
2484 |
* in the current quarter. If no dayOfWeek is provided, modify to the
|
2485 |
-
* first day of the current quarter. Use the supplied
|
2486 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
2487 |
*
|
2488 |
* @param int|null $dayOfWeek
|
@@ -2491,13 +3189,13 @@ class Carbon extends DateTime
|
|
2491 |
*/
|
2492 |
public function firstOfQuarter($dayOfWeek = null)
|
2493 |
{
|
2494 |
-
return $this->
|
2495 |
}
|
2496 |
|
2497 |
/**
|
2498 |
* Modify to the last occurrence of a given day of the week
|
2499 |
* in the current quarter. If no dayOfWeek is provided, modify to the
|
2500 |
-
* last day of the current quarter. Use the supplied
|
2501 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
2502 |
*
|
2503 |
* @param int|null $dayOfWeek
|
@@ -2506,14 +3204,14 @@ class Carbon extends DateTime
|
|
2506 |
*/
|
2507 |
public function lastOfQuarter($dayOfWeek = null)
|
2508 |
{
|
2509 |
-
return $this->
|
2510 |
}
|
2511 |
|
2512 |
/**
|
2513 |
* Modify to the given occurrence of a given day of the week
|
2514 |
* in the current quarter. If the calculated occurrence is outside the scope
|
2515 |
* of the current quarter, then return false and no modifications are made.
|
2516 |
-
* Use the supplied
|
2517 |
*
|
2518 |
* @param int $nth
|
2519 |
* @param int $dayOfWeek
|
@@ -2522,7 +3220,7 @@ class Carbon extends DateTime
|
|
2522 |
*/
|
2523 |
public function nthOfQuarter($nth, $dayOfWeek)
|
2524 |
{
|
2525 |
-
$dt = $this->copy()->day(1)->month($this->quarter *
|
2526 |
$lastMonth = $dt->month;
|
2527 |
$year = $dt->year;
|
2528 |
$dt->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
|
@@ -2533,7 +3231,7 @@ class Carbon extends DateTime
|
|
2533 |
/**
|
2534 |
* Modify to the first occurrence of a given day of the week
|
2535 |
* in the current year. If no dayOfWeek is provided, modify to the
|
2536 |
-
* first day of the current year. Use the supplied
|
2537 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
2538 |
*
|
2539 |
* @param int|null $dayOfWeek
|
@@ -2548,7 +3246,7 @@ class Carbon extends DateTime
|
|
2548 |
/**
|
2549 |
* Modify to the last occurrence of a given day of the week
|
2550 |
* in the current year. If no dayOfWeek is provided, modify to the
|
2551 |
-
* last day of the current year. Use the supplied
|
2552 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
2553 |
*
|
2554 |
* @param int|null $dayOfWeek
|
@@ -2564,7 +3262,7 @@ class Carbon extends DateTime
|
|
2564 |
* Modify to the given occurrence of a given day of the week
|
2565 |
* in the current year. If the calculated occurrence is outside the scope
|
2566 |
* of the current year, then return false and no modifications are made.
|
2567 |
-
* Use the supplied
|
2568 |
*
|
2569 |
* @param int $nth
|
2570 |
* @param int $dayOfWeek
|
@@ -2581,13 +3279,13 @@ class Carbon extends DateTime
|
|
2581 |
/**
|
2582 |
* Modify the current instance to the average of a given instance (default now) and the current instance.
|
2583 |
*
|
2584 |
-
* @param Carbon|null $dt
|
2585 |
*
|
2586 |
* @return static
|
2587 |
*/
|
2588 |
public function average(Carbon $dt = null)
|
2589 |
{
|
2590 |
-
$dt = $dt ?: static::now($this->
|
2591 |
|
2592 |
return $this->addSeconds((int) ($this->diffInSeconds($dt, false) / 2));
|
2593 |
}
|
@@ -2595,14 +3293,63 @@ class Carbon extends DateTime
|
|
2595 |
/**
|
2596 |
* Check if its the birthday. Compares the date/month values of the two dates.
|
2597 |
*
|
2598 |
-
* @param Carbon|null $dt The instance to compare with or null to use current day.
|
2599 |
*
|
2600 |
* @return bool
|
2601 |
*/
|
2602 |
public function isBirthday(Carbon $dt = null)
|
2603 |
{
|
2604 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2605 |
|
2606 |
-
return $
|
2607 |
}
|
2608 |
}
|
11 |
|
12 |
namespace Carbon;
|
13 |
|
14 |
+
use Carbon\Exceptions\InvalidDateException;
|
15 |
use Closure;
|
16 |
+
use DatePeriod;
|
17 |
use DateTime;
|
18 |
use DateTimeZone;
|
|
|
19 |
use InvalidArgumentException;
|
20 |
+
use Symfony\Component\Translation\Loader\ArrayLoader;
|
21 |
use Symfony\Component\Translation\Translator;
|
22 |
use Symfony\Component\Translation\TranslatorInterface;
|
|
|
23 |
|
24 |
/**
|
25 |
* A simple API extension for DateTime
|
32 |
* @property int $minute
|
33 |
* @property int $second
|
34 |
* @property int $timestamp seconds since the Unix Epoch
|
35 |
+
* @property \DateTimeZone $timezone the current timezone
|
36 |
+
* @property \DateTimeZone $tz alias of timezone
|
37 |
+
* @property-read int $micro
|
38 |
+
* @property-read int $dayOfWeek 0 (for Sunday) through 6 (for Saturday)
|
39 |
+
* @property-read int $dayOfYear 0 through 365
|
40 |
+
* @property-read int $weekOfMonth 1 through 5
|
41 |
+
* @property-read int $weekOfYear ISO-8601 week number of year, weeks starting on Monday
|
42 |
+
* @property-read int $daysInMonth number of days in the given month
|
43 |
+
* @property-read int $age does a diffInYears() with default parameters
|
44 |
+
* @property-read int $quarter the quarter of this instance, 1 - 4
|
45 |
+
* @property-read int $offset the timezone offset in seconds from UTC
|
46 |
+
* @property-read int $offsetHours the timezone offset in hours from UTC
|
47 |
+
* @property-read bool $dst daylight savings time indicator, true if DST, false otherwise
|
48 |
+
* @property-read bool $local checks if the timezone is local, true if local, false otherwise
|
49 |
+
* @property-read bool $utc checks if the timezone is UTC, true if UTC, false otherwise
|
50 |
+
* @property-read string $timezoneName
|
51 |
+
* @property-read string $tzName
|
52 |
*/
|
53 |
class Carbon extends DateTime
|
54 |
{
|
55 |
/**
|
56 |
+
* The day constants.
|
57 |
*/
|
58 |
const SUNDAY = 0;
|
59 |
const MONDAY = 1;
|
79 |
);
|
80 |
|
81 |
/**
|
82 |
+
* Terms used to detect if a time passed is a relative date.
|
83 |
+
*
|
84 |
+
* This is here for testing purposes.
|
85 |
*
|
86 |
* @var array
|
87 |
*/
|
88 |
protected static $relativeKeywords = array(
|
|
|
|
|
|
|
|
|
|
|
89 |
'+',
|
90 |
'-',
|
91 |
+
'ago',
|
92 |
'first',
|
93 |
'last',
|
94 |
+
'next',
|
95 |
+
'this',
|
96 |
+
'today',
|
97 |
+
'tomorrow',
|
98 |
+
'yesterday',
|
99 |
);
|
100 |
|
101 |
/**
|
102 |
+
* Number of X in Y.
|
103 |
*/
|
104 |
const YEARS_PER_CENTURY = 100;
|
105 |
const YEARS_PER_DECADE = 10;
|
106 |
const MONTHS_PER_YEAR = 12;
|
107 |
+
const MONTHS_PER_QUARTER = 3;
|
108 |
const WEEKS_PER_YEAR = 52;
|
109 |
const DAYS_PER_WEEK = 7;
|
110 |
const HOURS_PER_DAY = 24;
|
126 |
protected static $toStringFormat = self::DEFAULT_TO_STRING_FORMAT;
|
127 |
|
128 |
/**
|
129 |
+
* First day of week.
|
130 |
*
|
131 |
* @var int
|
132 |
*/
|
133 |
protected static $weekStartsAt = self::MONDAY;
|
134 |
|
135 |
/**
|
136 |
+
* Last day of week.
|
137 |
*
|
138 |
* @var int
|
139 |
*/
|
140 |
protected static $weekEndsAt = self::SUNDAY;
|
141 |
|
142 |
/**
|
143 |
+
* Days of weekend.
|
144 |
*
|
145 |
* @var array
|
146 |
*/
|
147 |
+
protected static $weekendDays = array(
|
148 |
+
self::SATURDAY,
|
149 |
+
self::SUNDAY,
|
150 |
+
);
|
151 |
|
152 |
/**
|
153 |
+
* A test Carbon instance to be returned when now instances are created.
|
154 |
*
|
155 |
+
* @var \Carbon\Carbon
|
156 |
*/
|
157 |
protected static $testNow;
|
158 |
|
159 |
/**
|
160 |
+
* A translator to ... er ... translate stuff.
|
161 |
*
|
162 |
+
* @var \Symfony\Component\Translation\TranslatorInterface
|
163 |
*/
|
164 |
protected static $translator;
|
165 |
|
166 |
/**
|
167 |
+
* The errors that can occur.
|
168 |
+
*
|
169 |
+
* @var array
|
170 |
+
*/
|
171 |
+
protected static $lastErrors;
|
172 |
+
|
173 |
+
/**
|
174 |
+
* Will UTF8 encoding be used to print localized date/time ?
|
175 |
+
*
|
176 |
+
* @var bool
|
177 |
+
*/
|
178 |
+
protected static $utf8 = false;
|
179 |
+
|
180 |
+
/*
|
181 |
+
* Indicates if months should be calculated with overflow.
|
182 |
+
*
|
183 |
+
* @var bool
|
184 |
+
*/
|
185 |
+
protected static $monthsOverflow = true;
|
186 |
+
|
187 |
+
/**
|
188 |
+
* Indicates if months should be calculated with overflow.
|
189 |
+
*
|
190 |
+
* @param bool $monthsOverflow
|
191 |
+
*
|
192 |
+
* @return void
|
193 |
+
*/
|
194 |
+
public static function useMonthsOverflow($monthsOverflow = true)
|
195 |
+
{
|
196 |
+
static::$monthsOverflow = $monthsOverflow;
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Reset the month overflow behavior.
|
201 |
+
*
|
202 |
+
* @return void
|
203 |
+
*/
|
204 |
+
public static function resetMonthsOverflow()
|
205 |
+
{
|
206 |
+
static::$monthsOverflow = true;
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Get the month overflow behavior.
|
211 |
+
*
|
212 |
+
* @return bool
|
213 |
+
*/
|
214 |
+
public static function shouldOverflowMonths()
|
215 |
+
{
|
216 |
+
return static::$monthsOverflow;
|
217 |
+
}
|
218 |
+
|
219 |
+
/**
|
220 |
+
* Creates a DateTimeZone from a string, DateTimeZone or integer offset.
|
221 |
*
|
222 |
+
* @param \DateTimeZone|string|int|null $object
|
223 |
*
|
224 |
+
* @throws \InvalidArgumentException
|
225 |
*
|
226 |
+
* @return \DateTimeZone
|
227 |
*/
|
228 |
protected static function safeCreateDateTimeZone($object)
|
229 |
{
|
236 |
return $object;
|
237 |
}
|
238 |
|
239 |
+
if (is_numeric($object)) {
|
240 |
+
$tzName = timezone_name_from_abbr(null, $object * 3600, true);
|
241 |
+
|
242 |
+
if ($tzName === false) {
|
243 |
+
throw new InvalidArgumentException('Unknown or bad timezone ('.$object.')');
|
244 |
+
}
|
245 |
+
|
246 |
+
$object = $tzName;
|
247 |
+
}
|
248 |
+
|
249 |
$tz = @timezone_open((string) $object);
|
250 |
|
251 |
if ($tz === false) {
|
265 |
* Please see the testing aids section (specifically static::setTestNow())
|
266 |
* for more on the possibility of this constructor returning a test instance.
|
267 |
*
|
268 |
+
* @param string|null $time
|
269 |
+
* @param \DateTimeZone|string|null $tz
|
270 |
*/
|
271 |
public function __construct($time = null, $tz = null)
|
272 |
{
|
279 |
}
|
280 |
|
281 |
//shift the time according to the given time zone
|
282 |
+
if ($tz !== null && $tz !== static::getTestNow()->getTimezone()) {
|
283 |
$testInstance->setTimezone($tz);
|
284 |
} else {
|
285 |
+
$tz = $testInstance->getTimezone();
|
286 |
}
|
287 |
|
288 |
$time = $testInstance->toDateTimeString();
|
292 |
}
|
293 |
|
294 |
/**
|
295 |
+
* Create a Carbon instance from a DateTime one.
|
296 |
*
|
297 |
+
* @param \DateTime $dt
|
298 |
*
|
299 |
* @return static
|
300 |
*/
|
301 |
public static function instance(DateTime $dt)
|
302 |
{
|
303 |
+
if ($dt instanceof static) {
|
304 |
+
return clone $dt;
|
305 |
+
}
|
306 |
+
|
307 |
+
return new static($dt->format('Y-m-d H:i:s.u'), $dt->getTimezone());
|
308 |
}
|
309 |
|
310 |
/**
|
311 |
+
* Create a carbon instance from a string.
|
|
|
|
|
|
|
312 |
*
|
313 |
+
* This is an alias for the constructor that allows better fluent syntax
|
314 |
+
* as it allows you to do Carbon::parse('Monday next week')->fn() rather
|
315 |
+
* than (new Carbon('Monday next week'))->fn().
|
316 |
+
*
|
317 |
+
* @param string|null $time
|
318 |
+
* @param \DateTimeZone|string|null $tz
|
319 |
*
|
320 |
* @return static
|
321 |
*/
|
325 |
}
|
326 |
|
327 |
/**
|
328 |
+
* Get a Carbon instance for the current date and time.
|
329 |
*
|
330 |
+
* @param \DateTimeZone|string|null $tz
|
331 |
*
|
332 |
* @return static
|
333 |
*/
|
337 |
}
|
338 |
|
339 |
/**
|
340 |
+
* Create a Carbon instance for today.
|
341 |
*
|
342 |
+
* @param \DateTimeZone|string|null $tz
|
343 |
*
|
344 |
* @return static
|
345 |
*/
|
349 |
}
|
350 |
|
351 |
/**
|
352 |
+
* Create a Carbon instance for tomorrow.
|
353 |
*
|
354 |
+
* @param \DateTimeZone|string|null $tz
|
355 |
*
|
356 |
* @return static
|
357 |
*/
|
361 |
}
|
362 |
|
363 |
/**
|
364 |
+
* Create a Carbon instance for yesterday.
|
365 |
*
|
366 |
+
* @param \DateTimeZone|string|null $tz
|
367 |
*
|
368 |
* @return static
|
369 |
*/
|
375 |
/**
|
376 |
* Create a Carbon instance for the greatest supported date.
|
377 |
*
|
378 |
+
* @return static
|
379 |
*/
|
380 |
public static function maxValue()
|
381 |
{
|
391 |
/**
|
392 |
* Create a Carbon instance for the lowest supported date.
|
393 |
*
|
394 |
+
* @return static
|
395 |
*/
|
396 |
public static function minValue()
|
397 |
{
|
407 |
/**
|
408 |
* Create a new Carbon instance from a specific date and time.
|
409 |
*
|
410 |
+
* If any of $year, $month or $day are set to null their now() values will
|
411 |
+
* be used.
|
412 |
+
*
|
413 |
+
* If $hour is null it will be set to its now() value and the default
|
414 |
+
* values for $minute and $second will be their now() values.
|
415 |
*
|
|
|
|
|
416 |
* If $hour is not null then the default values for $minute and $second
|
417 |
* will be 0.
|
418 |
*
|
419 |
+
* @param int|null $year
|
420 |
+
* @param int|null $month
|
421 |
+
* @param int|null $day
|
422 |
+
* @param int|null $hour
|
423 |
+
* @param int|null $minute
|
424 |
+
* @param int|null $second
|
425 |
+
* @param \DateTimeZone|string|null $tz
|
426 |
*
|
427 |
* @return static
|
428 |
*/
|
429 |
public static function create($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
|
430 |
{
|
431 |
+
$now = static::hasTestNow() ? static::getTestNow()->getTimestamp() : time();
|
432 |
+
|
433 |
+
$defaults = array_combine(array(
|
434 |
+
'year',
|
435 |
+
'month',
|
436 |
+
'day',
|
437 |
+
'hour',
|
438 |
+
'minute',
|
439 |
+
'second',
|
440 |
+
), explode('-', date('Y-n-j-G-i-s', $now)));
|
441 |
+
|
442 |
+
$year = $year === null ? $defaults['year'] : $year;
|
443 |
+
$month = $month === null ? $defaults['month'] : $month;
|
444 |
+
$day = $day === null ? $defaults['day'] : $day;
|
445 |
|
446 |
if ($hour === null) {
|
447 |
+
$hour = $defaults['hour'];
|
448 |
+
$minute = $minute === null ? $defaults['minute'] : $minute;
|
449 |
+
$second = $second === null ? $defaults['second'] : $second;
|
450 |
} else {
|
451 |
$minute = $minute === null ? 0 : $minute;
|
452 |
$second = $second === null ? 0 : $second;
|
453 |
}
|
454 |
|
455 |
+
$fixYear = null;
|
456 |
+
|
457 |
+
if ($year < 0) {
|
458 |
+
$fixYear = $year;
|
459 |
+
$year = 0;
|
460 |
+
} elseif ($year > 9999) {
|
461 |
+
$fixYear = $year - 9999;
|
462 |
+
$year = 9999;
|
463 |
+
}
|
464 |
+
|
465 |
+
$instance = static::createFromFormat('Y-n-j G:i:s', sprintf('%s-%s-%s %s:%02s:%02s', $year, $month, $day, $hour, $minute, $second), $tz);
|
466 |
+
|
467 |
+
if ($fixYear !== null) {
|
468 |
+
$instance->addYears($fixYear);
|
469 |
+
}
|
470 |
+
|
471 |
+
return $instance;
|
472 |
+
}
|
473 |
+
|
474 |
+
/**
|
475 |
+
* Create a new safe Carbon instance from a specific date and time.
|
476 |
+
*
|
477 |
+
* If any of $year, $month or $day are set to null their now() values will
|
478 |
+
* be used.
|
479 |
+
*
|
480 |
+
* If $hour is null it will be set to its now() value and the default
|
481 |
+
* values for $minute and $second will be their now() values.
|
482 |
+
*
|
483 |
+
* If $hour is not null then the default values for $minute and $second
|
484 |
+
* will be 0.
|
485 |
+
*
|
486 |
+
* If one of the set values is not valid, an \InvalidArgumentException
|
487 |
+
* will be thrown.
|
488 |
+
*
|
489 |
+
* @param int|null $year
|
490 |
+
* @param int|null $month
|
491 |
+
* @param int|null $day
|
492 |
+
* @param int|null $hour
|
493 |
+
* @param int|null $minute
|
494 |
+
* @param int|null $second
|
495 |
+
* @param \DateTimeZone|string|null $tz
|
496 |
+
*
|
497 |
+
* @throws \Carbon\Exceptions\InvalidDateException
|
498 |
+
*
|
499 |
+
* @return static
|
500 |
+
*/
|
501 |
+
public static function createSafe($year = null, $month = null, $day = null, $hour = null, $minute = null, $second = null, $tz = null)
|
502 |
+
{
|
503 |
+
$fields = array(
|
504 |
+
'year' => array(0, 9999),
|
505 |
+
'month' => array(0, 12),
|
506 |
+
'day' => array(0, 31),
|
507 |
+
'hour' => array(0, 24),
|
508 |
+
'minute' => array(0, 59),
|
509 |
+
'second' => array(0, 59),
|
510 |
+
);
|
511 |
+
|
512 |
+
foreach ($fields as $field => $range) {
|
513 |
+
if ($$field !== null && (!is_int($$field) || $$field < $range[0] || $$field > $range[1])) {
|
514 |
+
throw new InvalidDateException($field, $$field);
|
515 |
+
}
|
516 |
+
}
|
517 |
+
|
518 |
+
$instance = static::create($year, $month, 1, $hour, $minute, $second, $tz);
|
519 |
+
|
520 |
+
if ($day !== null && $day > $instance->daysInMonth) {
|
521 |
+
throw new InvalidDateException('day', $day);
|
522 |
+
}
|
523 |
+
|
524 |
+
return $instance->day($day);
|
525 |
}
|
526 |
|
527 |
/**
|
528 |
* Create a Carbon instance from just a date. The time portion is set to now.
|
529 |
*
|
530 |
+
* @param int|null $year
|
531 |
+
* @param int|null $month
|
532 |
+
* @param int|null $day
|
533 |
+
* @param \DateTimeZone|string|null $tz
|
534 |
*
|
535 |
* @return static
|
536 |
*/
|
542 |
/**
|
543 |
* Create a Carbon instance from just a time. The date portion is set to today.
|
544 |
*
|
545 |
+
* @param int|null $hour
|
546 |
+
* @param int|null $minute
|
547 |
+
* @param int|null $second
|
548 |
+
* @param \DateTimeZone|string|null $tz
|
549 |
*
|
550 |
* @return static
|
551 |
*/
|
555 |
}
|
556 |
|
557 |
/**
|
558 |
+
* Create a Carbon instance from a specific format.
|
559 |
*
|
560 |
+
* @param string $format
|
561 |
+
* @param string $time
|
562 |
+
* @param \DateTimeZone|string|null $tz
|
563 |
*
|
564 |
+
* @throws \InvalidArgumentException
|
565 |
*
|
566 |
* @return static
|
567 |
*/
|
573 |
$dt = parent::createFromFormat($format, $time);
|
574 |
}
|
575 |
|
576 |
+
static::setLastErrors($lastErrors = parent::getLastErrors());
|
577 |
+
|
578 |
if ($dt instanceof DateTime) {
|
579 |
return static::instance($dt);
|
580 |
}
|
581 |
|
582 |
+
throw new InvalidArgumentException(implode(PHP_EOL, $lastErrors['errors']));
|
583 |
+
}
|
584 |
+
|
585 |
+
/**
|
586 |
+
* Set last errors.
|
587 |
+
*
|
588 |
+
* @param array $lastErrors
|
589 |
+
*
|
590 |
+
* @return void
|
591 |
+
*/
|
592 |
+
private static function setLastErrors(array $lastErrors)
|
593 |
+
{
|
594 |
+
static::$lastErrors = $lastErrors;
|
595 |
+
}
|
596 |
+
|
597 |
+
/**
|
598 |
+
* {@inheritdoc}
|
599 |
+
*/
|
600 |
+
public static function getLastErrors()
|
601 |
+
{
|
602 |
+
return static::$lastErrors;
|
603 |
}
|
604 |
|
605 |
/**
|
606 |
+
* Create a Carbon instance from a timestamp.
|
607 |
*
|
608 |
+
* @param int $timestamp
|
609 |
+
* @param \DateTimeZone|string|null $tz
|
610 |
*
|
611 |
* @return static
|
612 |
*/
|
616 |
}
|
617 |
|
618 |
/**
|
619 |
+
* Create a Carbon instance from an UTC timestamp.
|
620 |
*
|
621 |
* @param int $timestamp
|
622 |
*
|
628 |
}
|
629 |
|
630 |
/**
|
631 |
+
* Get a copy of the instance.
|
632 |
*
|
633 |
* @return static
|
634 |
*/
|
635 |
public function copy()
|
636 |
{
|
637 |
+
return clone $this;
|
638 |
}
|
639 |
|
640 |
///////////////////////////////////////////////////////////////////
|
646 |
*
|
647 |
* @param string $name
|
648 |
*
|
649 |
+
* @throws \InvalidArgumentException
|
650 |
*
|
651 |
+
* @return string|int|\DateTimeZone
|
652 |
*/
|
653 |
public function __get($name)
|
654 |
{
|
674 |
return (int) ceil($this->day / static::DAYS_PER_WEEK);
|
675 |
|
676 |
case $name === 'age':
|
677 |
+
return $this->diffInYears();
|
678 |
|
679 |
case $name === 'quarter':
|
680 |
+
return (int) ceil($this->month / static::MONTHS_PER_QUARTER);
|
681 |
|
682 |
case $name === 'offset':
|
683 |
return $this->getOffset();
|
689 |
return $this->format('I') === '1';
|
690 |
|
691 |
case $name === 'local':
|
692 |
+
return $this->getOffset() === $this->copy()->setTimezone(date_default_timezone_get())->getOffset();
|
693 |
|
694 |
case $name === 'utc':
|
695 |
+
return $this->getOffset() === 0;
|
696 |
|
697 |
case $name === 'timezone' || $name === 'tz':
|
698 |
return $this->getTimezone();
|
726 |
/**
|
727 |
* Set a part of the Carbon object
|
728 |
*
|
729 |
+
* @param string $name
|
730 |
+
* @param string|int|\DateTimeZone $value
|
731 |
*
|
732 |
+
* @throws \InvalidArgumentException
|
733 |
*/
|
734 |
public function __set($name, $value)
|
735 |
{
|
736 |
switch ($name) {
|
737 |
case 'year':
|
|
|
|
|
|
|
738 |
case 'month':
|
|
|
|
|
|
|
739 |
case 'day':
|
|
|
|
|
|
|
740 |
case 'hour':
|
|
|
|
|
|
|
741 |
case 'minute':
|
|
|
|
|
|
|
742 |
case 'second':
|
743 |
+
list($year, $month, $day, $hour, $minute, $second) = explode('-', $this->format('Y-n-j-G-i-s'));
|
744 |
+
$$name = $value;
|
745 |
+
$this->setDateTime($year, $month, $day, $hour, $minute, $second);
|
746 |
break;
|
747 |
|
748 |
case 'timestamp':
|
843 |
return $this;
|
844 |
}
|
845 |
|
846 |
+
/**
|
847 |
+
* Sets the current date of the DateTime object to a different date.
|
848 |
+
* Calls modify as a workaround for a php bug
|
849 |
+
*
|
850 |
+
* @param int $year
|
851 |
+
* @param int $month
|
852 |
+
* @param int $day
|
853 |
+
*
|
854 |
+
* @return static
|
855 |
+
*
|
856 |
+
* @see https://github.com/briannesbitt/Carbon/issues/539
|
857 |
+
* @see https://bugs.php.net/bug.php?id=63863
|
858 |
+
*/
|
859 |
+
public function setDate($year, $month, $day)
|
860 |
+
{
|
861 |
+
$this->modify('+0 day');
|
862 |
+
|
863 |
+
return parent::setDate($year, $month, $day);
|
864 |
+
}
|
865 |
+
|
866 |
/**
|
867 |
* Set the date and time all together
|
868 |
*
|
889 |
*/
|
890 |
public function setTimeFromTimeString($time)
|
891 |
{
|
892 |
+
$time = explode(':', $time);
|
893 |
|
894 |
$hour = $time[0];
|
895 |
$minute = isset($time[1]) ? $time[1] : 0;
|
907 |
*/
|
908 |
public function timestamp($value)
|
909 |
{
|
910 |
+
return $this->setTimestamp($value);
|
|
|
|
|
911 |
}
|
912 |
|
913 |
/**
|
914 |
* Alias for setTimezone()
|
915 |
*
|
916 |
+
* @param \DateTimeZone|string $value
|
917 |
*
|
918 |
* @return static
|
919 |
*/
|
925 |
/**
|
926 |
* Alias for setTimezone()
|
927 |
*
|
928 |
+
* @param \DateTimeZone|string $value
|
929 |
*
|
930 |
* @return static
|
931 |
*/
|
937 |
/**
|
938 |
* Set the instance's timezone from a string or object
|
939 |
*
|
940 |
+
* @param \DateTimeZone|string $value
|
941 |
*
|
942 |
* @return static
|
943 |
*/
|
944 |
public function setTimezone($value)
|
945 |
{
|
946 |
+
return parent::setTimezone(static::safeCreateDateTimeZone($value));
|
|
|
|
|
947 |
}
|
948 |
|
949 |
///////////////////////////////////////////////////////////////////
|
981 |
}
|
982 |
|
983 |
/**
|
984 |
+
* Set the last day of week
|
985 |
*
|
986 |
* @param int
|
987 |
*/
|
1021 |
* - A call to the static now() method, ex. Carbon::now()
|
1022 |
* - When a null (or blank string) is passed to the constructor or parse(), ex. new Carbon(null)
|
1023 |
* - When the string "now" is passed to the constructor or parse(), ex. new Carbon('now')
|
1024 |
+
* - When a string containing the desired time is passed to Carbon::parse().
|
1025 |
*
|
1026 |
* Note the timezone parameter was left out of the examples above and
|
1027 |
* has no affect as the mock value will be returned regardless of its value.
|
1029 |
* To clear the test instance call this method using the default
|
1030 |
* parameter of null.
|
1031 |
*
|
1032 |
+
* @param \Carbon\Carbon|string|null $testNow
|
1033 |
*/
|
1034 |
+
public static function setTestNow($testNow = null)
|
1035 |
{
|
1036 |
+
static::$testNow = is_string($testNow) ? static::parse($testNow) : $testNow;
|
1037 |
}
|
1038 |
|
1039 |
/**
|
1069 |
public static function hasRelativeKeywords($time)
|
1070 |
{
|
1071 |
// skip common format with a '-' in it
|
1072 |
+
if (preg_match('/\d{4}-\d{1,2}-\d{1,2}/', $time) !== 1) {
|
1073 |
foreach (static::$relativeKeywords as $keyword) {
|
1074 |
if (stripos($time, $keyword) !== false) {
|
1075 |
return true;
|
1085 |
///////////////////////////////////////////////////////////////////
|
1086 |
|
1087 |
/**
|
1088 |
+
* Initialize the translator instance if necessary.
|
1089 |
*
|
1090 |
+
* @return \Symfony\Component\Translation\TranslatorInterface
|
1091 |
*/
|
1092 |
protected static function translator()
|
1093 |
{
|
1103 |
/**
|
1104 |
* Get the translator instance in use
|
1105 |
*
|
1106 |
+
* @return \Symfony\Component\Translation\TranslatorInterface
|
1107 |
*/
|
1108 |
public static function getTranslator()
|
1109 |
{
|
1113 |
/**
|
1114 |
* Set the translator instance to use
|
1115 |
*
|
1116 |
+
* @param \Symfony\Component\Translation\TranslatorInterface $translator
|
1117 |
*/
|
1118 |
public static function setTranslator(TranslatorInterface $translator)
|
1119 |
{
|
1131 |
}
|
1132 |
|
1133 |
/**
|
1134 |
+
* Set the current translator locale and indicate if the source locale file exists
|
1135 |
*
|
1136 |
* @param string $locale
|
1137 |
+
*
|
1138 |
+
* @return bool
|
1139 |
*/
|
1140 |
public static function setLocale($locale)
|
1141 |
{
|
1142 |
+
$locale = preg_replace_callback('/\b([a-z]{2})[-_](?:([a-z]{4})[-_])?([a-z]{2})\b/', function ($matches) {
|
1143 |
+
return $matches[1].'_'.(!empty($matches[2]) ? ucfirst($matches[2]).'_' : '').strtoupper($matches[3]);
|
1144 |
+
}, strtolower($locale));
|
1145 |
+
|
1146 |
+
if (file_exists($filename = __DIR__.'/Lang/'.$locale.'.php')) {
|
1147 |
+
static::translator()->setLocale($locale);
|
1148 |
+
// Ensure the locale has been loaded.
|
1149 |
+
static::translator()->addResource('array', require $filename, $locale);
|
1150 |
+
|
1151 |
+
return true;
|
1152 |
+
}
|
1153 |
|
1154 |
+
return false;
|
|
|
1155 |
}
|
1156 |
|
1157 |
///////////////////////////////////////////////////////////////////
|
1158 |
/////////////////////// STRING FORMATTING /////////////////////////
|
1159 |
///////////////////////////////////////////////////////////////////
|
1160 |
|
1161 |
+
/**
|
1162 |
+
* Set if UTF8 will be used for localized date/time
|
1163 |
+
*
|
1164 |
+
* @param bool $utf8
|
1165 |
+
*/
|
1166 |
+
public static function setUtf8($utf8)
|
1167 |
+
{
|
1168 |
+
static::$utf8 = $utf8;
|
1169 |
+
}
|
1170 |
+
|
1171 |
/**
|
1172 |
* Format the instance with the current locale. You can set the current
|
1173 |
* locale using setlocale() http://php.net/setlocale.
|
1184 |
$format = preg_replace('#(?<!%)((?:%%)*)%e#', '\1%#d', $format);
|
1185 |
}
|
1186 |
|
1187 |
+
$formatted = strftime($format, strtotime($this));
|
1188 |
+
|
1189 |
+
return static::$utf8 ? utf8_encode($formatted) : $formatted;
|
1190 |
}
|
1191 |
|
1192 |
/**
|
1294 |
*/
|
1295 |
public function toIso8601String()
|
1296 |
{
|
1297 |
+
return $this->toAtomString();
|
1298 |
}
|
1299 |
|
1300 |
/**
|
1393 |
return $this == $dt;
|
1394 |
}
|
1395 |
|
1396 |
+
/**
|
1397 |
+
* Determines if the instance is equal to another
|
1398 |
+
*
|
1399 |
+
* @param Carbon $dt
|
1400 |
+
*
|
1401 |
+
* @see eq()
|
1402 |
+
*
|
1403 |
+
* @return bool
|
1404 |
+
*/
|
1405 |
+
public function equalTo(Carbon $dt)
|
1406 |
+
{
|
1407 |
+
return $this->eq($dt);
|
1408 |
+
}
|
1409 |
+
|
1410 |
/**
|
1411 |
* Determines if the instance is not equal to another
|
1412 |
*
|
1419 |
return !$this->eq($dt);
|
1420 |
}
|
1421 |
|
1422 |
+
/**
|
1423 |
+
* Determines if the instance is not equal to another
|
1424 |
+
*
|
1425 |
+
* @param Carbon $dt
|
1426 |
+
*
|
1427 |
+
* @see ne()
|
1428 |
+
*
|
1429 |
+
* @return bool
|
1430 |
+
*/
|
1431 |
+
public function notEqualTo(Carbon $dt)
|
1432 |
+
{
|
1433 |
+
return $this->ne($dt);
|
1434 |
+
}
|
1435 |
+
|
1436 |
/**
|
1437 |
* Determines if the instance is greater (after) than another
|
1438 |
*
|
1445 |
return $this > $dt;
|
1446 |
}
|
1447 |
|
1448 |
+
/**
|
1449 |
+
* Determines if the instance is greater (after) than another
|
1450 |
+
*
|
1451 |
+
* @param Carbon $dt
|
1452 |
+
*
|
1453 |
+
* @see gt()
|
1454 |
+
*
|
1455 |
+
* @return bool
|
1456 |
+
*/
|
1457 |
+
public function greaterThan(Carbon $dt)
|
1458 |
+
{
|
1459 |
+
return $this->gt($dt);
|
1460 |
+
}
|
1461 |
+
|
1462 |
/**
|
1463 |
* Determines if the instance is greater (after) than or equal to another
|
1464 |
*
|
1471 |
return $this >= $dt;
|
1472 |
}
|
1473 |
|
1474 |
+
/**
|
1475 |
+
* Determines if the instance is greater (after) than or equal to another
|
1476 |
+
*
|
1477 |
+
* @param Carbon $dt
|
1478 |
+
*
|
1479 |
+
* @see gte()
|
1480 |
+
*
|
1481 |
+
* @return bool
|
1482 |
+
*/
|
1483 |
+
public function greaterThanOrEqualTo(Carbon $dt)
|
1484 |
+
{
|
1485 |
+
return $this->gte($dt);
|
1486 |
+
}
|
1487 |
+
|
1488 |
/**
|
1489 |
* Determines if the instance is less (before) than another
|
1490 |
*
|
1497 |
return $this < $dt;
|
1498 |
}
|
1499 |
|
1500 |
+
/**
|
1501 |
+
* Determines if the instance is less (before) than another
|
1502 |
+
*
|
1503 |
+
* @param Carbon $dt
|
1504 |
+
*
|
1505 |
+
* @see lt()
|
1506 |
+
*
|
1507 |
+
* @return bool
|
1508 |
+
*/
|
1509 |
+
public function lessThan(Carbon $dt)
|
1510 |
+
{
|
1511 |
+
return $this->lt($dt);
|
1512 |
+
}
|
1513 |
+
|
1514 |
/**
|
1515 |
* Determines if the instance is less (before) or equal to another
|
1516 |
*
|
1523 |
return $this <= $dt;
|
1524 |
}
|
1525 |
|
1526 |
+
/**
|
1527 |
+
* Determines if the instance is less (before) or equal to another
|
1528 |
+
*
|
1529 |
+
* @param Carbon $dt
|
1530 |
+
*
|
1531 |
+
* @see lte()
|
1532 |
+
*
|
1533 |
+
* @return bool
|
1534 |
+
*/
|
1535 |
+
public function lessThanOrEqualTo(Carbon $dt)
|
1536 |
+
{
|
1537 |
+
return $this->lte($dt);
|
1538 |
+
}
|
1539 |
+
|
1540 |
/**
|
1541 |
* Determines if the instance is between two others
|
1542 |
*
|
1590 |
/**
|
1591 |
* Get the minimum instance between a given instance (default now) and the current instance.
|
1592 |
*
|
1593 |
+
* @param \Carbon\Carbon|null $dt
|
1594 |
*
|
1595 |
* @return static
|
1596 |
*/
|
1597 |
public function min(Carbon $dt = null)
|
1598 |
{
|
1599 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
1600 |
|
1601 |
return $this->lt($dt) ? $this : $dt;
|
1602 |
}
|
1603 |
|
1604 |
+
/**
|
1605 |
+
* Get the minimum instance between a given instance (default now) and the current instance.
|
1606 |
+
*
|
1607 |
+
* @param \Carbon\Carbon|null $dt
|
1608 |
+
*
|
1609 |
+
* @see min()
|
1610 |
+
*
|
1611 |
+
* @return static
|
1612 |
+
*/
|
1613 |
+
public function minimum(Carbon $dt = null)
|
1614 |
+
{
|
1615 |
+
return $this->min($dt);
|
1616 |
+
}
|
1617 |
+
|
1618 |
/**
|
1619 |
* Get the maximum instance between a given instance (default now) and the current instance.
|
1620 |
*
|
1621 |
+
* @param \Carbon\Carbon|null $dt
|
1622 |
*
|
1623 |
* @return static
|
1624 |
*/
|
1625 |
public function max(Carbon $dt = null)
|
1626 |
{
|
1627 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
1628 |
|
1629 |
return $this->gt($dt) ? $this : $dt;
|
1630 |
}
|
1631 |
|
1632 |
+
/**
|
1633 |
+
* Get the maximum instance between a given instance (default now) and the current instance.
|
1634 |
+
*
|
1635 |
+
* @param \Carbon\Carbon|null $dt
|
1636 |
+
*
|
1637 |
+
* @see max()
|
1638 |
+
*
|
1639 |
+
* @return static
|
1640 |
+
*/
|
1641 |
+
public function maximum(Carbon $dt = null)
|
1642 |
+
{
|
1643 |
+
return $this->max($dt);
|
1644 |
+
}
|
1645 |
+
|
1646 |
/**
|
1647 |
* Determines if the instance is a weekday
|
1648 |
*
|
1660 |
*/
|
1661 |
public function isWeekend()
|
1662 |
{
|
1663 |
+
return in_array($this->dayOfWeek, static::$weekendDays);
|
1664 |
}
|
1665 |
|
1666 |
/**
|
1670 |
*/
|
1671 |
public function isYesterday()
|
1672 |
{
|
1673 |
+
return $this->toDateString() === static::yesterday($this->getTimezone())->toDateString();
|
1674 |
}
|
1675 |
|
1676 |
/**
|
1680 |
*/
|
1681 |
public function isToday()
|
1682 |
{
|
1683 |
+
return $this->toDateString() === static::now($this->getTimezone())->toDateString();
|
1684 |
}
|
1685 |
|
1686 |
/**
|
1690 |
*/
|
1691 |
public function isTomorrow()
|
1692 |
{
|
1693 |
+
return $this->toDateString() === static::tomorrow($this->getTimezone())->toDateString();
|
1694 |
}
|
1695 |
|
1696 |
/**
|
1697 |
+
* Determines if the instance is within the next week
|
1698 |
*
|
1699 |
* @return bool
|
1700 |
*/
|
1701 |
+
public function isNextWeek()
|
1702 |
{
|
1703 |
+
return $this->weekOfYear === static::now($this->getTimezone())->addWeek()->weekOfYear;
|
1704 |
}
|
1705 |
|
1706 |
/**
|
1707 |
+
* Determines if the instance is within the last week
|
1708 |
*
|
1709 |
* @return bool
|
1710 |
*/
|
1711 |
+
public function isLastWeek()
|
1712 |
{
|
1713 |
+
return $this->weekOfYear === static::now($this->getTimezone())->subWeek()->weekOfYear;
|
1714 |
}
|
1715 |
|
1716 |
/**
|
1717 |
+
* Determines if the instance is within the next month
|
1718 |
*
|
1719 |
* @return bool
|
1720 |
*/
|
1721 |
+
public function isNextMonth()
|
1722 |
{
|
1723 |
+
return $this->month === static::now($this->getTimezone())->addMonthNoOverflow()->month;
|
1724 |
}
|
1725 |
|
1726 |
/**
|
1727 |
+
* Determines if the instance is within the last month
|
|
|
|
|
1728 |
*
|
1729 |
* @return bool
|
1730 |
*/
|
1731 |
+
public function isLastMonth()
|
1732 |
{
|
1733 |
+
return $this->month === static::now($this->getTimezone())->subMonthNoOverflow()->month;
|
1734 |
}
|
1735 |
|
1736 |
/**
|
1737 |
+
* Determines if the instance is within next year
|
1738 |
*
|
1739 |
* @return bool
|
1740 |
*/
|
1741 |
+
public function isNextYear()
|
1742 |
{
|
1743 |
+
return $this->year === static::now($this->getTimezone())->addYear()->year;
|
1744 |
}
|
1745 |
|
1746 |
/**
|
1747 |
+
* Determines if the instance is within the previous year
|
1748 |
*
|
1749 |
* @return bool
|
1750 |
*/
|
1751 |
+
public function isLastYear()
|
1752 |
{
|
1753 |
+
return $this->year === static::now($this->getTimezone())->subYear()->year;
|
1754 |
}
|
1755 |
|
1756 |
/**
|
1757 |
+
* Determines if the instance is in the future, ie. greater (after) than now
|
1758 |
*
|
1759 |
* @return bool
|
1760 |
*/
|
1761 |
+
public function isFuture()
|
1762 |
{
|
1763 |
+
return $this->gt(static::now($this->getTimezone()));
|
1764 |
}
|
1765 |
|
1766 |
/**
|
1767 |
+
* Determines if the instance is in the past, ie. less (before) than now
|
1768 |
+
*
|
1769 |
+
* @return bool
|
1770 |
+
*/
|
1771 |
+
public function isPast()
|
1772 |
+
{
|
1773 |
+
return $this->lt(static::now($this->getTimezone()));
|
1774 |
+
}
|
1775 |
+
|
1776 |
+
/**
|
1777 |
+
* Determines if the instance is a leap year
|
1778 |
+
*
|
1779 |
+
* @return bool
|
1780 |
+
*/
|
1781 |
+
public function isLeapYear()
|
1782 |
+
{
|
1783 |
+
return $this->format('L') === '1';
|
1784 |
+
}
|
1785 |
+
|
1786 |
+
/**
|
1787 |
+
* Determines if the instance is a long year
|
1788 |
+
*
|
1789 |
+
* @see https://en.wikipedia.org/wiki/ISO_8601#Week_dates
|
1790 |
+
*
|
1791 |
+
* @return bool
|
1792 |
+
*/
|
1793 |
+
public function isLongYear()
|
1794 |
+
{
|
1795 |
+
return static::create($this->year, 12, 28, 0, 0, 0, $this->tz)->weekOfYear === 53;
|
1796 |
+
}
|
1797 |
+
|
1798 |
+
/*
|
1799 |
+
* Compares the formatted values of the two dates.
|
1800 |
+
*
|
1801 |
+
* @param string $format The date formats to compare.
|
1802 |
+
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
1803 |
+
*
|
1804 |
+
* @return bool
|
1805 |
+
*/
|
1806 |
+
public function isSameAs($format, Carbon $dt = null)
|
1807 |
+
{
|
1808 |
+
$dt = $dt ?: static::now($this->tz);
|
1809 |
+
|
1810 |
+
return $this->format($format) === $dt->format($format);
|
1811 |
+
}
|
1812 |
+
|
1813 |
+
/**
|
1814 |
+
* Determines if the instance is in the current year
|
1815 |
+
*
|
1816 |
+
* @return bool
|
1817 |
+
*/
|
1818 |
+
public function isCurrentYear()
|
1819 |
+
{
|
1820 |
+
return $this->isSameYear();
|
1821 |
+
}
|
1822 |
+
|
1823 |
+
/**
|
1824 |
+
* Checks if the passed in date is in the same year as the instance year.
|
1825 |
+
*
|
1826 |
+
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
1827 |
+
*
|
1828 |
+
* @return bool
|
1829 |
+
*/
|
1830 |
+
public function isSameYear(Carbon $dt = null)
|
1831 |
+
{
|
1832 |
+
return $this->isSameAs('Y', $dt);
|
1833 |
+
}
|
1834 |
+
|
1835 |
+
/**
|
1836 |
+
* Determines if the instance is in the current month
|
1837 |
+
*
|
1838 |
+
* @return bool
|
1839 |
+
*/
|
1840 |
+
public function isCurrentMonth()
|
1841 |
+
{
|
1842 |
+
return $this->isSameMonth();
|
1843 |
+
}
|
1844 |
+
|
1845 |
+
/**
|
1846 |
+
* Checks if the passed in date is in the same month as the instance month (and year if needed).
|
1847 |
+
*
|
1848 |
+
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
1849 |
+
* @param bool $ofSameYear Check if it is the same month in the same year.
|
1850 |
+
*
|
1851 |
+
* @return bool
|
1852 |
+
*/
|
1853 |
+
public function isSameMonth(Carbon $dt = null, $ofSameYear = false)
|
1854 |
+
{
|
1855 |
+
$format = $ofSameYear ? 'Y-m' : 'm';
|
1856 |
+
|
1857 |
+
return $this->isSameAs($format, $dt);
|
1858 |
+
}
|
1859 |
+
|
1860 |
+
/**
|
1861 |
+
* Checks if the passed in date is the same day as the instance current day.
|
1862 |
+
*
|
1863 |
+
* @param \Carbon\Carbon $dt
|
1864 |
+
*
|
1865 |
+
* @return bool
|
1866 |
+
*/
|
1867 |
+
public function isSameDay(Carbon $dt)
|
1868 |
+
{
|
1869 |
+
return $this->toDateString() === $dt->toDateString();
|
1870 |
+
}
|
1871 |
+
|
1872 |
+
/**
|
1873 |
+
* Checks if this day is a Sunday.
|
1874 |
+
*
|
1875 |
+
* @return bool
|
1876 |
+
*/
|
1877 |
+
public function isSunday()
|
1878 |
+
{
|
1879 |
+
return $this->dayOfWeek === static::SUNDAY;
|
1880 |
+
}
|
1881 |
+
|
1882 |
+
/**
|
1883 |
+
* Checks if this day is a Monday.
|
1884 |
+
*
|
1885 |
+
* @return bool
|
1886 |
+
*/
|
1887 |
+
public function isMonday()
|
1888 |
+
{
|
1889 |
+
return $this->dayOfWeek === static::MONDAY;
|
1890 |
+
}
|
1891 |
+
|
1892 |
+
/**
|
1893 |
+
* Checks if this day is a Tuesday.
|
1894 |
+
*
|
1895 |
+
* @return bool
|
1896 |
+
*/
|
1897 |
+
public function isTuesday()
|
1898 |
+
{
|
1899 |
+
return $this->dayOfWeek === static::TUESDAY;
|
1900 |
+
}
|
1901 |
+
|
1902 |
+
/**
|
1903 |
+
* Checks if this day is a Wednesday.
|
1904 |
*
|
1905 |
* @return bool
|
1906 |
*/
|
1992 |
return $this->addYears(-1 * $value);
|
1993 |
}
|
1994 |
|
1995 |
+
/**
|
1996 |
+
* Add quarters to the instance. Positive $value travels forward while
|
1997 |
+
* negative $value travels into the past.
|
1998 |
+
*
|
1999 |
+
* @param int $value
|
2000 |
+
*
|
2001 |
+
* @return static
|
2002 |
+
*/
|
2003 |
+
public function addQuarters($value)
|
2004 |
+
{
|
2005 |
+
return $this->addMonths(static::MONTHS_PER_QUARTER * $value);
|
2006 |
+
}
|
2007 |
+
|
2008 |
+
/**
|
2009 |
+
* Add a quarter to the instance
|
2010 |
+
*
|
2011 |
+
* @param int $value
|
2012 |
+
*
|
2013 |
+
* @return static
|
2014 |
+
*/
|
2015 |
+
public function addQuarter($value = 1)
|
2016 |
+
{
|
2017 |
+
return $this->addQuarters($value);
|
2018 |
+
}
|
2019 |
+
|
2020 |
+
/**
|
2021 |
+
* Remove a quarter from the instance
|
2022 |
+
*
|
2023 |
+
* @param int $value
|
2024 |
+
*
|
2025 |
+
* @return static
|
2026 |
+
*/
|
2027 |
+
public function subQuarter($value = 1)
|
2028 |
+
{
|
2029 |
+
return $this->subQuarters($value);
|
2030 |
+
}
|
2031 |
+
|
2032 |
+
/**
|
2033 |
+
* Remove quarters from the instance
|
2034 |
+
*
|
2035 |
+
* @param int $value
|
2036 |
+
*
|
2037 |
+
* @return static
|
2038 |
+
*/
|
2039 |
+
public function subQuarters($value)
|
2040 |
+
{
|
2041 |
+
return $this->addQuarters(-1 * $value);
|
2042 |
+
}
|
2043 |
+
|
2044 |
+
/**
|
2045 |
+
* Add centuries to the instance. Positive $value travels forward while
|
2046 |
+
* negative $value travels into the past.
|
2047 |
+
*
|
2048 |
+
* @param int $value
|
2049 |
+
*
|
2050 |
+
* @return static
|
2051 |
+
*/
|
2052 |
+
public function addCenturies($value)
|
2053 |
+
{
|
2054 |
+
return $this->addYears(static::YEARS_PER_CENTURY * $value);
|
2055 |
+
}
|
2056 |
+
|
2057 |
+
/**
|
2058 |
+
* Add a century to the instance
|
2059 |
+
*
|
2060 |
+
* @param int $value
|
2061 |
+
*
|
2062 |
+
* @return static
|
2063 |
+
*/
|
2064 |
+
public function addCentury($value = 1)
|
2065 |
+
{
|
2066 |
+
return $this->addCenturies($value);
|
2067 |
+
}
|
2068 |
+
|
2069 |
+
/**
|
2070 |
+
* Remove a century from the instance
|
2071 |
+
*
|
2072 |
+
* @param int $value
|
2073 |
+
*
|
2074 |
+
* @return static
|
2075 |
+
*/
|
2076 |
+
public function subCentury($value = 1)
|
2077 |
+
{
|
2078 |
+
return $this->subCenturies($value);
|
2079 |
+
}
|
2080 |
+
|
2081 |
+
/**
|
2082 |
+
* Remove centuries from the instance
|
2083 |
+
*
|
2084 |
+
* @param int $value
|
2085 |
+
*
|
2086 |
+
* @return static
|
2087 |
+
*/
|
2088 |
+
public function subCenturies($value)
|
2089 |
+
{
|
2090 |
+
return $this->addCenturies(-1 * $value);
|
2091 |
+
}
|
2092 |
+
|
2093 |
/**
|
2094 |
* Add months to the instance. Positive $value travels forward while
|
2095 |
* negative $value travels into the past.
|
2100 |
*/
|
2101 |
public function addMonths($value)
|
2102 |
{
|
2103 |
+
if (static::shouldOverflowMonths()) {
|
2104 |
+
return $this->addMonthsWithOverflow($value);
|
2105 |
+
}
|
2106 |
+
|
2107 |
+
return $this->addMonthsNoOverflow($value);
|
2108 |
}
|
2109 |
|
2110 |
/**
|
2143 |
return $this->addMonths(-1 * $value);
|
2144 |
}
|
2145 |
|
2146 |
+
/**
|
2147 |
+
* Add months to the instance. Positive $value travels forward while
|
2148 |
+
* negative $value travels into the past.
|
2149 |
+
*
|
2150 |
+
* @param int $value
|
2151 |
+
*
|
2152 |
+
* @return static
|
2153 |
+
*/
|
2154 |
+
public function addMonthsWithOverflow($value)
|
2155 |
+
{
|
2156 |
+
return $this->modify((int) $value.' month');
|
2157 |
+
}
|
2158 |
+
|
2159 |
+
/**
|
2160 |
+
* Add a month to the instance
|
2161 |
+
*
|
2162 |
+
* @param int $value
|
2163 |
+
*
|
2164 |
+
* @return static
|
2165 |
+
*/
|
2166 |
+
public function addMonthWithOverflow($value = 1)
|
2167 |
+
{
|
2168 |
+
return $this->addMonthsWithOverflow($value);
|
2169 |
+
}
|
2170 |
+
|
2171 |
+
/**
|
2172 |
+
* Remove a month from the instance
|
2173 |
+
*
|
2174 |
+
* @param int $value
|
2175 |
+
*
|
2176 |
+
* @return static
|
2177 |
+
*/
|
2178 |
+
public function subMonthWithOverflow($value = 1)
|
2179 |
+
{
|
2180 |
+
return $this->subMonthsWithOverflow($value);
|
2181 |
+
}
|
2182 |
+
|
2183 |
+
/**
|
2184 |
+
* Remove months from the instance
|
2185 |
+
*
|
2186 |
+
* @param int $value
|
2187 |
+
*
|
2188 |
+
* @return static
|
2189 |
+
*/
|
2190 |
+
public function subMonthsWithOverflow($value)
|
2191 |
+
{
|
2192 |
+
return $this->addMonthsWithOverflow(-1 * $value);
|
2193 |
+
}
|
2194 |
+
|
2195 |
/**
|
2196 |
* Add months without overflowing to the instance. Positive $value
|
2197 |
* travels forward while negative $value travels into the past.
|
2202 |
*/
|
2203 |
public function addMonthsNoOverflow($value)
|
2204 |
{
|
2205 |
+
$day = $this->day;
|
2206 |
|
2207 |
+
$this->modify((int) $value.' month');
|
2208 |
+
|
2209 |
+
if ($day !== $this->day) {
|
2210 |
+
$this->modify('last day of previous month');
|
2211 |
}
|
2212 |
|
2213 |
+
return $this;
|
2214 |
}
|
2215 |
|
2216 |
/**
|
2308 |
*/
|
2309 |
public function addWeekdays($value)
|
2310 |
{
|
2311 |
+
// fix for https://bugs.php.net/bug.php?id=54909
|
2312 |
+
$t = $this->toTimeString();
|
2313 |
+
$this->modify((int) $value.' weekday');
|
2314 |
+
|
2315 |
+
return $this->setTimeFromTimeString($t);
|
2316 |
}
|
2317 |
|
2318 |
/**
|
2554 |
/**
|
2555 |
* Get the difference in years
|
2556 |
*
|
2557 |
+
* @param \Carbon\Carbon|null $dt
|
2558 |
+
* @param bool $abs Get the absolute of the difference
|
2559 |
*
|
2560 |
* @return int
|
2561 |
*/
|
2562 |
public function diffInYears(Carbon $dt = null, $abs = true)
|
2563 |
{
|
2564 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
2565 |
|
2566 |
return (int) $this->diff($dt, $abs)->format('%r%y');
|
2567 |
}
|
2569 |
/**
|
2570 |
* Get the difference in months
|
2571 |
*
|
2572 |
+
* @param \Carbon\Carbon|null $dt
|
2573 |
+
* @param bool $abs Get the absolute of the difference
|
2574 |
*
|
2575 |
* @return int
|
2576 |
*/
|
2577 |
public function diffInMonths(Carbon $dt = null, $abs = true)
|
2578 |
{
|
2579 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
2580 |
|
2581 |
return $this->diffInYears($dt, $abs) * static::MONTHS_PER_YEAR + (int) $this->diff($dt, $abs)->format('%r%m');
|
2582 |
}
|
2584 |
/**
|
2585 |
* Get the difference in weeks
|
2586 |
*
|
2587 |
+
* @param \Carbon\Carbon|null $dt
|
2588 |
+
* @param bool $abs Get the absolute of the difference
|
2589 |
*
|
2590 |
* @return int
|
2591 |
*/
|
2597 |
/**
|
2598 |
* Get the difference in days
|
2599 |
*
|
2600 |
+
* @param \Carbon\Carbon|null $dt
|
2601 |
+
* @param bool $abs Get the absolute of the difference
|
2602 |
*
|
2603 |
* @return int
|
2604 |
*/
|
2605 |
public function diffInDays(Carbon $dt = null, $abs = true)
|
2606 |
{
|
2607 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
2608 |
|
2609 |
return (int) $this->diff($dt, $abs)->format('%r%a');
|
2610 |
}
|
2612 |
/**
|
2613 |
* Get the difference in days using a filter closure
|
2614 |
*
|
2615 |
+
* @param Closure $callback
|
2616 |
+
* @param \Carbon\Carbon|null $dt
|
2617 |
+
* @param bool $abs Get the absolute of the difference
|
2618 |
*
|
2619 |
* @return int
|
2620 |
*/
|
2626 |
/**
|
2627 |
* Get the difference in hours using a filter closure
|
2628 |
*
|
2629 |
+
* @param Closure $callback
|
2630 |
+
* @param \Carbon\Carbon|null $dt
|
2631 |
+
* @param bool $abs Get the absolute of the difference
|
2632 |
*
|
2633 |
* @return int
|
2634 |
*/
|
2650 |
public function diffFiltered(CarbonInterval $ci, Closure $callback, Carbon $dt = null, $abs = true)
|
2651 |
{
|
2652 |
$start = $this;
|
2653 |
+
$end = $dt ?: static::now($this->getTimezone());
|
2654 |
$inverse = false;
|
2655 |
|
2656 |
if ($end < $start) {
|
2672 |
/**
|
2673 |
* Get the difference in weekdays
|
2674 |
*
|
2675 |
+
* @param \Carbon\Carbon|null $dt
|
2676 |
+
* @param bool $abs Get the absolute of the difference
|
2677 |
*
|
2678 |
* @return int
|
2679 |
*/
|
2687 |
/**
|
2688 |
* Get the difference in weekend days using a filter
|
2689 |
*
|
2690 |
+
* @param \Carbon\Carbon|null $dt
|
2691 |
+
* @param bool $abs Get the absolute of the difference
|
2692 |
*
|
2693 |
* @return int
|
2694 |
*/
|
2702 |
/**
|
2703 |
* Get the difference in hours
|
2704 |
*
|
2705 |
+
* @param \Carbon\Carbon|null $dt
|
2706 |
+
* @param bool $abs Get the absolute of the difference
|
2707 |
*
|
2708 |
* @return int
|
2709 |
*/
|
2715 |
/**
|
2716 |
* Get the difference in minutes
|
2717 |
*
|
2718 |
+
* @param \Carbon\Carbon|null $dt
|
2719 |
+
* @param bool $abs Get the absolute of the difference
|
2720 |
*
|
2721 |
* @return int
|
2722 |
*/
|
2728 |
/**
|
2729 |
* Get the difference in seconds
|
2730 |
*
|
2731 |
+
* @param \Carbon\Carbon|null $dt
|
2732 |
+
* @param bool $abs Get the absolute of the difference
|
2733 |
*
|
2734 |
* @return int
|
2735 |
*/
|
2736 |
public function diffInSeconds(Carbon $dt = null, $abs = true)
|
2737 |
{
|
2738 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
2739 |
$value = $dt->getTimestamp() - $this->getTimestamp();
|
2740 |
|
2741 |
return $abs ? abs($value) : $value;
|
2782 |
*
|
2783 |
* @param Carbon|null $other
|
2784 |
* @param bool $absolute removes time difference modifiers ago, after, etc
|
2785 |
+
* @param bool $short displays short format of time units
|
2786 |
*
|
2787 |
* @return string
|
2788 |
*/
|
2789 |
+
public function diffForHumans(Carbon $other = null, $absolute = false, $short = false)
|
2790 |
{
|
2791 |
$isNow = $other === null;
|
2792 |
|
2793 |
if ($isNow) {
|
2794 |
+
$other = static::now($this->getTimezone());
|
2795 |
}
|
2796 |
|
2797 |
$diffInterval = $this->diff($other);
|
2798 |
|
2799 |
switch (true) {
|
2800 |
+
case $diffInterval->y > 0:
|
2801 |
+
$unit = $short ? 'y' : 'year';
|
2802 |
$count = $diffInterval->y;
|
2803 |
break;
|
2804 |
|
2805 |
+
case $diffInterval->m > 0:
|
2806 |
+
$unit = $short ? 'm' : 'month';
|
2807 |
$count = $diffInterval->m;
|
2808 |
break;
|
2809 |
|
2810 |
+
case $diffInterval->d > 0:
|
2811 |
+
$unit = $short ? 'd' : 'day';
|
2812 |
$count = $diffInterval->d;
|
2813 |
+
|
2814 |
+
if ($count >= static::DAYS_PER_WEEK) {
|
2815 |
+
$unit = $short ? 'w' : 'week';
|
2816 |
+
$count = (int) ($count / static::DAYS_PER_WEEK);
|
2817 |
}
|
2818 |
break;
|
2819 |
|
2820 |
+
case $diffInterval->h > 0:
|
2821 |
+
$unit = $short ? 'h' : 'hour';
|
2822 |
$count = $diffInterval->h;
|
2823 |
break;
|
2824 |
|
2825 |
+
case $diffInterval->i > 0:
|
2826 |
+
$unit = $short ? 'min' : 'minute';
|
2827 |
$count = $diffInterval->i;
|
2828 |
break;
|
2829 |
|
2830 |
default:
|
2831 |
$count = $diffInterval->s;
|
2832 |
+
$unit = $short ? 's' : 'second';
|
2833 |
break;
|
2834 |
}
|
2835 |
|
2867 |
*/
|
2868 |
public function startOfDay()
|
2869 |
{
|
2870 |
+
return $this->setTime(0, 0, 0);
|
2871 |
}
|
2872 |
|
2873 |
/**
|
2877 |
*/
|
2878 |
public function endOfDay()
|
2879 |
{
|
2880 |
+
return $this->setTime(23, 59, 59);
|
2881 |
}
|
2882 |
|
2883 |
/**
|
2887 |
*/
|
2888 |
public function startOfMonth()
|
2889 |
{
|
2890 |
+
return $this->setDateTime($this->year, $this->month, 1, 0, 0, 0);
|
2891 |
}
|
2892 |
|
2893 |
/**
|
2897 |
*/
|
2898 |
public function endOfMonth()
|
2899 |
{
|
2900 |
+
return $this->setDateTime($this->year, $this->month, $this->daysInMonth, 23, 59, 59);
|
2901 |
+
}
|
2902 |
+
|
2903 |
+
/**
|
2904 |
+
* Resets the date to the first day of the quarter and the time to 00:00:00
|
2905 |
+
*
|
2906 |
+
* @return static
|
2907 |
+
*/
|
2908 |
+
public function startOfQuarter()
|
2909 |
+
{
|
2910 |
+
$month = ($this->quarter - 1) * static::MONTHS_PER_QUARTER + 1;
|
2911 |
+
|
2912 |
+
return $this->setDateTime($this->year, $month, 1, 0, 0, 0);
|
2913 |
+
}
|
2914 |
+
|
2915 |
+
/**
|
2916 |
+
* Resets the date to end of the quarter and time to 23:59:59
|
2917 |
+
*
|
2918 |
+
* @return static
|
2919 |
+
*/
|
2920 |
+
public function endOfQuarter()
|
2921 |
+
{
|
2922 |
+
return $this->startOfQuarter()->addMonths(static::MONTHS_PER_QUARTER - 1)->endOfMonth();
|
2923 |
}
|
2924 |
|
2925 |
/**
|
2929 |
*/
|
2930 |
public function startOfYear()
|
2931 |
{
|
2932 |
+
return $this->setDateTime($this->year, 1, 1, 0, 0, 0);
|
2933 |
}
|
2934 |
|
2935 |
/**
|
2939 |
*/
|
2940 |
public function endOfYear()
|
2941 |
{
|
2942 |
+
return $this->setDateTime($this->year, 12, 31, 23, 59, 59);
|
2943 |
}
|
2944 |
|
2945 |
/**
|
2949 |
*/
|
2950 |
public function startOfDecade()
|
2951 |
{
|
2952 |
+
$year = $this->year - $this->year % static::YEARS_PER_DECADE;
|
2953 |
+
|
2954 |
+
return $this->setDateTime($year, 1, 1, 0, 0, 0);
|
2955 |
}
|
2956 |
|
2957 |
/**
|
2961 |
*/
|
2962 |
public function endOfDecade()
|
2963 |
{
|
2964 |
+
$year = $this->year - $this->year % static::YEARS_PER_DECADE + static::YEARS_PER_DECADE - 1;
|
2965 |
+
|
2966 |
+
return $this->setDateTime($year, 12, 31, 23, 59, 59);
|
2967 |
}
|
2968 |
|
2969 |
/**
|
2973 |
*/
|
2974 |
public function startOfCentury()
|
2975 |
{
|
2976 |
+
$year = $this->year - ($this->year - 1) % static::YEARS_PER_CENTURY;
|
2977 |
+
|
2978 |
+
return $this->setDateTime($year, 1, 1, 0, 0, 0);
|
2979 |
}
|
2980 |
|
2981 |
/**
|
2985 |
*/
|
2986 |
public function endOfCentury()
|
2987 |
{
|
2988 |
+
$year = $this->year - 1 - ($this->year - 1) % static::YEARS_PER_CENTURY + static::YEARS_PER_CENTURY;
|
2989 |
+
|
2990 |
+
return $this->setDateTime($year, 12, 31, 23, 59, 59);
|
2991 |
}
|
2992 |
|
2993 |
/**
|
2997 |
*/
|
2998 |
public function startOfWeek()
|
2999 |
{
|
3000 |
+
while ($this->dayOfWeek !== static::$weekStartsAt) {
|
3001 |
+
$this->subDay();
|
3002 |
}
|
3003 |
|
3004 |
return $this->startOfDay();
|
3011 |
*/
|
3012 |
public function endOfWeek()
|
3013 |
{
|
3014 |
+
while ($this->dayOfWeek !== static::$weekEndsAt) {
|
3015 |
+
$this->addDay();
|
3016 |
}
|
3017 |
|
3018 |
return $this->endOfDay();
|
3021 |
/**
|
3022 |
* Modify to the next occurrence of a given day of the week.
|
3023 |
* If no dayOfWeek is provided, modify to the next occurrence
|
3024 |
+
* of the current day of the week. Use the supplied constants
|
3025 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3026 |
*
|
3027 |
* @param int|null $dayOfWeek
|
3037 |
return $this->startOfDay()->modify('next '.static::$days[$dayOfWeek]);
|
3038 |
}
|
3039 |
|
3040 |
+
/**
|
3041 |
+
* Go forward or backward to the next week- or weekend-day.
|
3042 |
+
*
|
3043 |
+
* @param bool $weekday
|
3044 |
+
* @param bool $forward
|
3045 |
+
*
|
3046 |
+
* @return static
|
3047 |
+
*/
|
3048 |
+
private function nextOrPreviousDay($weekday = true, $forward = true)
|
3049 |
+
{
|
3050 |
+
$step = $forward ? 1 : -1;
|
3051 |
+
|
3052 |
+
do {
|
3053 |
+
$this->addDay($step);
|
3054 |
+
} while ($weekday ? $this->isWeekend() : $this->isWeekday());
|
3055 |
+
|
3056 |
+
return $this;
|
3057 |
+
}
|
3058 |
+
|
3059 |
+
/**
|
3060 |
+
* Go forward to the next weekday.
|
3061 |
+
*
|
3062 |
+
* @return $this
|
3063 |
+
*/
|
3064 |
+
public function nextWeekday()
|
3065 |
+
{
|
3066 |
+
return $this->nextOrPreviousDay();
|
3067 |
+
}
|
3068 |
+
|
3069 |
+
/**
|
3070 |
+
* Go backward to the previous weekday.
|
3071 |
+
*
|
3072 |
+
* @return static
|
3073 |
+
*/
|
3074 |
+
public function previousWeekday()
|
3075 |
+
{
|
3076 |
+
return $this->nextOrPreviousDay(true, false);
|
3077 |
+
}
|
3078 |
+
|
3079 |
+
/**
|
3080 |
+
* Go forward to the next weekend day.
|
3081 |
+
*
|
3082 |
+
* @return static
|
3083 |
+
*/
|
3084 |
+
public function nextWeekendDay()
|
3085 |
+
{
|
3086 |
+
return $this->nextOrPreviousDay(false);
|
3087 |
+
}
|
3088 |
+
|
3089 |
+
/**
|
3090 |
+
* Go backward to the previous weekend day.
|
3091 |
+
*
|
3092 |
+
* @return static
|
3093 |
+
*/
|
3094 |
+
public function previousWeekendDay()
|
3095 |
+
{
|
3096 |
+
return $this->nextOrPreviousDay(false, false);
|
3097 |
+
}
|
3098 |
+
|
3099 |
/**
|
3100 |
* Modify to the previous occurrence of a given day of the week.
|
3101 |
* If no dayOfWeek is provided, modify to the previous occurrence
|
3102 |
+
* of the current day of the week. Use the supplied constants
|
3103 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3104 |
*
|
3105 |
* @param int|null $dayOfWeek
|
3118 |
/**
|
3119 |
* Modify to the first occurrence of a given day of the week
|
3120 |
* in the current month. If no dayOfWeek is provided, modify to the
|
3121 |
+
* first day of the current month. Use the supplied constants
|
3122 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3123 |
*
|
3124 |
* @param int|null $dayOfWeek
|
3139 |
/**
|
3140 |
* Modify to the last occurrence of a given day of the week
|
3141 |
* in the current month. If no dayOfWeek is provided, modify to the
|
3142 |
+
* last day of the current month. Use the supplied constants
|
3143 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3144 |
*
|
3145 |
* @param int|null $dayOfWeek
|
3161 |
* Modify to the given occurrence of a given day of the week
|
3162 |
* in the current month. If the calculated occurrence is outside the scope
|
3163 |
* of the current month, then return false and no modifications are made.
|
3164 |
+
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3165 |
*
|
3166 |
* @param int $nth
|
3167 |
* @param int $dayOfWeek
|
3180 |
/**
|
3181 |
* Modify to the first occurrence of a given day of the week
|
3182 |
* in the current quarter. If no dayOfWeek is provided, modify to the
|
3183 |
+
* first day of the current quarter. Use the supplied constants
|
3184 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3185 |
*
|
3186 |
* @param int|null $dayOfWeek
|
3189 |
*/
|
3190 |
public function firstOfQuarter($dayOfWeek = null)
|
3191 |
{
|
3192 |
+
return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER - 2, 1)->firstOfMonth($dayOfWeek);
|
3193 |
}
|
3194 |
|
3195 |
/**
|
3196 |
* Modify to the last occurrence of a given day of the week
|
3197 |
* in the current quarter. If no dayOfWeek is provided, modify to the
|
3198 |
+
* last day of the current quarter. Use the supplied constants
|
3199 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3200 |
*
|
3201 |
* @param int|null $dayOfWeek
|
3204 |
*/
|
3205 |
public function lastOfQuarter($dayOfWeek = null)
|
3206 |
{
|
3207 |
+
return $this->setDate($this->year, $this->quarter * static::MONTHS_PER_QUARTER, 1)->lastOfMonth($dayOfWeek);
|
3208 |
}
|
3209 |
|
3210 |
/**
|
3211 |
* Modify to the given occurrence of a given day of the week
|
3212 |
* in the current quarter. If the calculated occurrence is outside the scope
|
3213 |
* of the current quarter, then return false and no modifications are made.
|
3214 |
+
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3215 |
*
|
3216 |
* @param int $nth
|
3217 |
* @param int $dayOfWeek
|
3220 |
*/
|
3221 |
public function nthOfQuarter($nth, $dayOfWeek)
|
3222 |
{
|
3223 |
+
$dt = $this->copy()->day(1)->month($this->quarter * static::MONTHS_PER_QUARTER);
|
3224 |
$lastMonth = $dt->month;
|
3225 |
$year = $dt->year;
|
3226 |
$dt->firstOfQuarter()->modify('+'.$nth.' '.static::$days[$dayOfWeek]);
|
3231 |
/**
|
3232 |
* Modify to the first occurrence of a given day of the week
|
3233 |
* in the current year. If no dayOfWeek is provided, modify to the
|
3234 |
+
* first day of the current year. Use the supplied constants
|
3235 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3236 |
*
|
3237 |
* @param int|null $dayOfWeek
|
3246 |
/**
|
3247 |
* Modify to the last occurrence of a given day of the week
|
3248 |
* in the current year. If no dayOfWeek is provided, modify to the
|
3249 |
+
* last day of the current year. Use the supplied constants
|
3250 |
* to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3251 |
*
|
3252 |
* @param int|null $dayOfWeek
|
3262 |
* Modify to the given occurrence of a given day of the week
|
3263 |
* in the current year. If the calculated occurrence is outside the scope
|
3264 |
* of the current year, then return false and no modifications are made.
|
3265 |
+
* Use the supplied constants to indicate the desired dayOfWeek, ex. static::MONDAY.
|
3266 |
*
|
3267 |
* @param int $nth
|
3268 |
* @param int $dayOfWeek
|
3279 |
/**
|
3280 |
* Modify the current instance to the average of a given instance (default now) and the current instance.
|
3281 |
*
|
3282 |
+
* @param \Carbon\Carbon|null $dt
|
3283 |
*
|
3284 |
* @return static
|
3285 |
*/
|
3286 |
public function average(Carbon $dt = null)
|
3287 |
{
|
3288 |
+
$dt = $dt ?: static::now($this->getTimezone());
|
3289 |
|
3290 |
return $this->addSeconds((int) ($this->diffInSeconds($dt, false) / 2));
|
3291 |
}
|
3293 |
/**
|
3294 |
* Check if its the birthday. Compares the date/month values of the two dates.
|
3295 |
*
|
3296 |
+
* @param \Carbon\Carbon|null $dt The instance to compare with or null to use current day.
|
3297 |
*
|
3298 |
* @return bool
|
3299 |
*/
|
3300 |
public function isBirthday(Carbon $dt = null)
|
3301 |
{
|
3302 |
+
return $this->isSameAs('md', $dt);
|
3303 |
+
}
|
3304 |
+
|
3305 |
+
/**
|
3306 |
+
* Consider the timezone when modifying the instance.
|
3307 |
+
*
|
3308 |
+
* @param string $modify
|
3309 |
+
*
|
3310 |
+
* @return static
|
3311 |
+
*/
|
3312 |
+
public function modify($modify)
|
3313 |
+
{
|
3314 |
+
if ($this->local) {
|
3315 |
+
return parent::modify($modify);
|
3316 |
+
}
|
3317 |
+
|
3318 |
+
$timezone = $this->getTimezone();
|
3319 |
+
$this->setTimezone('UTC');
|
3320 |
+
$instance = parent::modify($modify);
|
3321 |
+
$this->setTimezone($timezone);
|
3322 |
+
|
3323 |
+
return $instance;
|
3324 |
+
}
|
3325 |
+
|
3326 |
+
/**
|
3327 |
+
* Return a serialized string of the instance.
|
3328 |
+
*
|
3329 |
+
* @return string
|
3330 |
+
*/
|
3331 |
+
public function serialize()
|
3332 |
+
{
|
3333 |
+
return serialize($this);
|
3334 |
+
}
|
3335 |
+
|
3336 |
+
/**
|
3337 |
+
* Create an instance form a serialized string.
|
3338 |
+
*
|
3339 |
+
* @param string $value
|
3340 |
+
*
|
3341 |
+
* @throws \InvalidArgumentException
|
3342 |
+
*
|
3343 |
+
* @return static
|
3344 |
+
*/
|
3345 |
+
public static function fromSerialized($value)
|
3346 |
+
{
|
3347 |
+
$instance = @unserialize($value);
|
3348 |
+
|
3349 |
+
if (!$instance instanceof static) {
|
3350 |
+
throw new InvalidArgumentException('Invalid serialized value.');
|
3351 |
+
}
|
3352 |
|
3353 |
+
return $instance;
|
3354 |
}
|
3355 |
}
|
vendor/nesbot/carbon/src/Carbon/CarbonInterval.php
CHANGED
@@ -13,13 +13,13 @@ namespace Carbon;
|
|
13 |
|
14 |
use DateInterval;
|
15 |
use InvalidArgumentException;
|
|
|
16 |
use Symfony\Component\Translation\Translator;
|
17 |
use Symfony\Component\Translation\TranslatorInterface;
|
18 |
-
use Symfony\Component\Translation\Loader\ArrayLoader;
|
19 |
|
20 |
/**
|
21 |
* A simple API extension for DateInterval.
|
22 |
-
* The
|
23 |
* Weeks are calculated based on the total days of the current instance.
|
24 |
*
|
25 |
* @property int $years Total years of the current interval.
|
@@ -29,9 +29,8 @@ use Symfony\Component\Translation\Loader\ArrayLoader;
|
|
29 |
* @property int $hours Total hours of the current interval.
|
30 |
* @property int $minutes Total minutes of the current interval.
|
31 |
* @property int $seconds Total seconds of the current interval.
|
32 |
-
*
|
33 |
-
* @property-read
|
34 |
-
* @property-read integer $daysExcludeWeeks alias of dayzExcludeWeeks
|
35 |
*
|
36 |
* @method static CarbonInterval years($years = 1) Create instance specifying a number of years.
|
37 |
* @method static CarbonInterval year($years = 1) Alias for years()
|
@@ -81,7 +80,7 @@ class CarbonInterval extends DateInterval
|
|
81 |
/**
|
82 |
* A translator to ... er ... translate stuff
|
83 |
*
|
84 |
-
* @var TranslatorInterface
|
85 |
*/
|
86 |
protected static $translator;
|
87 |
|
@@ -221,14 +220,14 @@ class CarbonInterval extends DateInterval
|
|
221 |
*
|
222 |
* @param DateInterval $di
|
223 |
*
|
224 |
-
* @throws InvalidArgumentException
|
225 |
*
|
226 |
* @return static
|
227 |
*/
|
228 |
public static function instance(DateInterval $di)
|
229 |
{
|
230 |
if (static::wasCreatedFromDiff($di)) {
|
231 |
-
throw new InvalidArgumentException(
|
232 |
}
|
233 |
|
234 |
$instance = new static($di->y, $di->m, 0, $di->d, $di->h, $di->i, $di->s);
|
@@ -243,9 +242,9 @@ class CarbonInterval extends DateInterval
|
|
243 |
///////////////////////////////////////////////////////////////////
|
244 |
|
245 |
/**
|
246 |
-
*
|
247 |
*
|
248 |
-
* @return TranslatorInterface
|
249 |
*/
|
250 |
protected static function translator()
|
251 |
{
|
@@ -261,7 +260,7 @@ class CarbonInterval extends DateInterval
|
|
261 |
/**
|
262 |
* Get the translator instance in use
|
263 |
*
|
264 |
-
* @return TranslatorInterface
|
265 |
*/
|
266 |
public static function getTranslator()
|
267 |
{
|
@@ -310,7 +309,7 @@ class CarbonInterval extends DateInterval
|
|
310 |
*
|
311 |
* @param string $name
|
312 |
*
|
313 |
-
* @throws InvalidArgumentException
|
314 |
*
|
315 |
* @return int
|
316 |
*/
|
@@ -336,7 +335,7 @@ class CarbonInterval extends DateInterval
|
|
336 |
return $this->s;
|
337 |
|
338 |
case 'weeks':
|
339 |
-
return (int)floor($this->d / Carbon::DAYS_PER_WEEK);
|
340 |
|
341 |
case 'daysExcludeWeeks':
|
342 |
case 'dayzExcludeWeeks':
|
@@ -353,7 +352,7 @@ class CarbonInterval extends DateInterval
|
|
353 |
* @param string $name
|
354 |
* @param int $val
|
355 |
*
|
356 |
-
* @throws InvalidArgumentException
|
357 |
*/
|
358 |
public function __set($name, $val)
|
359 |
{
|
@@ -508,16 +507,51 @@ class CarbonInterval extends DateInterval
|
|
508 |
$sign = $interval->invert === 1 ? -1 : 1;
|
509 |
|
510 |
if (static::wasCreatedFromDiff($interval)) {
|
511 |
-
$this->dayz
|
512 |
} else {
|
513 |
-
$this->years
|
514 |
-
$this->months
|
515 |
-
$this->dayz
|
516 |
-
$this->hours
|
517 |
-
$this->minutes
|
518 |
-
$this->seconds
|
519 |
}
|
520 |
|
521 |
return $this;
|
522 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
523 |
}
|
13 |
|
14 |
use DateInterval;
|
15 |
use InvalidArgumentException;
|
16 |
+
use Symfony\Component\Translation\Loader\ArrayLoader;
|
17 |
use Symfony\Component\Translation\Translator;
|
18 |
use Symfony\Component\Translation\TranslatorInterface;
|
|
|
19 |
|
20 |
/**
|
21 |
* A simple API extension for DateInterval.
|
22 |
+
* The implementation provides helpers to handle weeks but only days are saved.
|
23 |
* Weeks are calculated based on the total days of the current instance.
|
24 |
*
|
25 |
* @property int $years Total years of the current interval.
|
29 |
* @property int $hours Total hours of the current interval.
|
30 |
* @property int $minutes Total minutes of the current interval.
|
31 |
* @property int $seconds Total seconds of the current interval.
|
32 |
+
* @property-read int $dayzExcludeWeeks Total days remaining in the final week of the current instance (days % 7).
|
33 |
+
* @property-read int $daysExcludeWeeks alias of dayzExcludeWeeks
|
|
|
34 |
*
|
35 |
* @method static CarbonInterval years($years = 1) Create instance specifying a number of years.
|
36 |
* @method static CarbonInterval year($years = 1) Alias for years()
|
80 |
/**
|
81 |
* A translator to ... er ... translate stuff
|
82 |
*
|
83 |
+
* @var \Symfony\Component\Translation\TranslatorInterface
|
84 |
*/
|
85 |
protected static $translator;
|
86 |
|
220 |
*
|
221 |
* @param DateInterval $di
|
222 |
*
|
223 |
+
* @throws \InvalidArgumentException
|
224 |
*
|
225 |
* @return static
|
226 |
*/
|
227 |
public static function instance(DateInterval $di)
|
228 |
{
|
229 |
if (static::wasCreatedFromDiff($di)) {
|
230 |
+
throw new InvalidArgumentException('Can not instance a DateInterval object created from DateTime::diff().');
|
231 |
}
|
232 |
|
233 |
$instance = new static($di->y, $di->m, 0, $di->d, $di->h, $di->i, $di->s);
|
242 |
///////////////////////////////////////////////////////////////////
|
243 |
|
244 |
/**
|
245 |
+
* Initialize the translator instance if necessary.
|
246 |
*
|
247 |
+
* @return \Symfony\Component\Translation\TranslatorInterface
|
248 |
*/
|
249 |
protected static function translator()
|
250 |
{
|
260 |
/**
|
261 |
* Get the translator instance in use
|
262 |
*
|
263 |
+
* @return \Symfony\Component\Translation\TranslatorInterface
|
264 |
*/
|
265 |
public static function getTranslator()
|
266 |
{
|
309 |
*
|
310 |
* @param string $name
|
311 |
*
|
312 |
+
* @throws \InvalidArgumentException
|
313 |
*
|
314 |
* @return int
|
315 |
*/
|
335 |
return $this->s;
|
336 |
|
337 |
case 'weeks':
|
338 |
+
return (int) floor($this->d / Carbon::DAYS_PER_WEEK);
|
339 |
|
340 |
case 'daysExcludeWeeks':
|
341 |
case 'dayzExcludeWeeks':
|
352 |
* @param string $name
|
353 |
* @param int $val
|
354 |
*
|
355 |
+
* @throws \InvalidArgumentException
|
356 |
*/
|
357 |
public function __set($name, $val)
|
358 |
{
|
507 |
$sign = $interval->invert === 1 ? -1 : 1;
|
508 |
|
509 |
if (static::wasCreatedFromDiff($interval)) {
|
510 |
+
$this->dayz += $interval->days * $sign;
|
511 |
} else {
|
512 |
+
$this->years += $interval->y * $sign;
|
513 |
+
$this->months += $interval->m * $sign;
|
514 |
+
$this->dayz += $interval->d * $sign;
|
515 |
+
$this->hours += $interval->h * $sign;
|
516 |
+
$this->minutes += $interval->i * $sign;
|
517 |
+
$this->seconds += $interval->s * $sign;
|
518 |
}
|
519 |
|
520 |
return $this;
|
521 |
}
|
522 |
+
|
523 |
+
/**
|
524 |
+
* Get the interval_spec string
|
525 |
+
*
|
526 |
+
* @return string
|
527 |
+
*/
|
528 |
+
public function spec()
|
529 |
+
{
|
530 |
+
$date = array_filter(array(
|
531 |
+
static::PERIOD_YEARS => $this->y,
|
532 |
+
static::PERIOD_MONTHS => $this->m,
|
533 |
+
static::PERIOD_DAYS => $this->d,
|
534 |
+
));
|
535 |
+
|
536 |
+
$time = array_filter(array(
|
537 |
+
static::PERIOD_HOURS => $this->h,
|
538 |
+
static::PERIOD_MINUTES => $this->i,
|
539 |
+
static::PERIOD_SECONDS => $this->s,
|
540 |
+
));
|
541 |
+
|
542 |
+
$specString = static::PERIOD_PREFIX;
|
543 |
+
|
544 |
+
foreach ($date as $key => $value) {
|
545 |
+
$specString .= $value.$key;
|
546 |
+
}
|
547 |
+
|
548 |
+
if (count($time) > 0) {
|
549 |
+
$specString .= static::PERIOD_TIME_PREFIX;
|
550 |
+
foreach ($time as $key => $value) {
|
551 |
+
$specString .= $value.$key;
|
552 |
+
}
|
553 |
+
}
|
554 |
+
|
555 |
+
return $specString === static::PERIOD_PREFIX ? 'PT0S' : $specString;
|
556 |
+
}
|
557 |
}
|
vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidDateException.php
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
namespace Carbon\Exceptions;
|
13 |
+
|
14 |
+
use Exception;
|
15 |
+
use InvalidArgumentException;
|
16 |
+
|
17 |
+
class InvalidDateException extends InvalidArgumentException
|
18 |
+
{
|
19 |
+
/**
|
20 |
+
* The invalid field.
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
private $field;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The invalid value.
|
28 |
+
*
|
29 |
+
* @var mixed
|
30 |
+
*/
|
31 |
+
private $value;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Constructor.
|
35 |
+
*
|
36 |
+
* @param string $field
|
37 |
+
* @param mixed $value
|
38 |
+
* @param int $code
|
39 |
+
* @param \Exception|null $previous
|
40 |
+
*/
|
41 |
+
public function __construct($field, $value, $code = 0, Exception $previous = null)
|
42 |
+
{
|
43 |
+
$this->field = $field;
|
44 |
+
$this->value = $value;
|
45 |
+
parent::__construct($field.' : '.$value.' is not a valid value.', $code, $previous);
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Get the invalid field.
|
50 |
+
*
|
51 |
+
* @return string
|
52 |
+
*/
|
53 |
+
public function getField()
|
54 |
+
{
|
55 |
+
return $this->field;
|
56 |
+
}
|
57 |
+
|
58 |
+
/**
|
59 |
+
* Get the invalid value.
|
60 |
+
*
|
61 |
+
* @return mixed
|
62 |
+
*/
|
63 |
+
public function getValue()
|
64 |
+
{
|
65 |
+
return $this->value;
|
66 |
+
}
|
67 |
+
}
|
vendor/nesbot/carbon/src/Carbon/Exceptions/index.php
ADDED
File without changes
|
vendor/nesbot/carbon/src/Carbon/Lang/af.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 jaar|:count jare',
|
14 |
+
'y' => '1 jaar|:count jare',
|
15 |
+
'month' => '1 maand|:count maande',
|
16 |
+
'm' => '1 maand|:count maande',
|
17 |
+
'week' => '1 week|:count weke',
|
18 |
+
'w' => '1 week|:count weke',
|
19 |
+
'day' => '1 dag|:count dae',
|
20 |
+
'd' => '1 dag|:count dae',
|
21 |
+
'hour' => '1 uur|:count ure',
|
22 |
+
'h' => '1 uur|:count ure',
|
23 |
+
'minute' => '1 minuut|:count minute',
|
24 |
+
'min' => '1 minuut|:count minute',
|
25 |
+
'second' => '1 sekond|:count sekondes',
|
26 |
+
's' => '1 sekond|:count sekondes',
|
27 |
+
'ago' => ':time terug',
|
28 |
+
'from_now' => ':time van nou af',
|
29 |
+
'after' => ':time na',
|
30 |
+
'before' => ':time voor',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/ar.php
CHANGED
@@ -8,24 +8,24 @@
|
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
-
/**
|
12 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
13 |
-
* for possible formats.
|
14 |
-
*/
|
15 |
-
/**
|
16 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/ar/date.php
|
17 |
-
*/
|
18 |
|
19 |
return array(
|
20 |
-
'year'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
29 |
-
'
|
30 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
);
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
return array(
|
13 |
+
'year' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة',
|
14 |
+
'y' => '{0}سنة|{1}سنة|{2}سنتين|[3,10]:count سنوات|[11,Inf]:count سنة',
|
15 |
+
'month' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر',
|
16 |
+
'm' => '{0}شهر|{1} شهر|{2}شهرين|[3,10]:count أشهر|[11,Inf]:count شهر',
|
17 |
+
'week' => '{0}إسبوع|{1}إسبوع|{2}إسبوعين|[3,10]:count أسابيع|[11,Inf]:count إسبوع',
|
18 |
+
'w' => '{0}إسبوع|{1}إسبوع|{2}إسبوعين|[3,10]:count أسابيع|[11,Inf]:count إسبوع',
|
19 |
+
'day' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم',
|
20 |
+
'd' => '{0}يوم|{1}يوم|{2}يومين|[3,10]:count أيام|[11,Inf] يوم',
|
21 |
+
'hour' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة',
|
22 |
+
'h' => '{0}ساعة|{1}ساعة|{2}ساعتين|[3,10]:count ساعات|[11,Inf]:count ساعة',
|
23 |
+
'minute' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة',
|
24 |
+
'min' => '{0}دقيقة|{1}دقيقة|{2}دقيقتين|[3,10]:count دقائق|[11,Inf]:count دقيقة',
|
25 |
+
'second' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية',
|
26 |
+
's' => '{0}ثانية|{1}ثانية|{2}ثانيتين|[3,10]:count ثوان|[11,Inf]:count ثانية',
|
27 |
+
'ago' => 'منذ :time',
|
28 |
+
'from_now' => 'من الآن :time',
|
29 |
+
'after' => 'بعد :time',
|
30 |
+
'before' => 'قبل :time',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/az.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/The-Hasanov/laravel-date/blob/1006f37c431178b5c7219d02c93579c9690ae546/src/Lang/az.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count il',
|
14 |
+
'y' => ':count il',
|
15 |
+
'month' => ':count ay',
|
16 |
+
'm' => ':count ay',
|
17 |
+
'week' => ':count həftə',
|
18 |
+
'w' => ':count həftə',
|
19 |
+
'day' => ':count gün',
|
20 |
+
'd' => ':count gün',
|
21 |
+
'hour' => ':count saat',
|
22 |
+
'h' => ':count saat',
|
23 |
+
'minute' => ':count dəqiqə',
|
24 |
+
'min' => ':count dəqiqə',
|
25 |
+
'second' => ':count saniyə',
|
26 |
+
's' => ':count saniyə',
|
27 |
+
'ago' => ':time öncə',
|
28 |
+
'from_now' => ':time sonra',
|
29 |
+
'after' => ':time sonra',
|
30 |
+
'before' => ':time öncə',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/bg.php
CHANGED
@@ -8,24 +8,24 @@
|
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
-
/**
|
12 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
13 |
-
* for possible formats.
|
14 |
-
*/
|
15 |
-
/**
|
16 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/bg/date.php
|
17 |
-
*/
|
18 |
|
19 |
return array(
|
20 |
-
'year'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
29 |
-
'
|
30 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
);
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
return array(
|
13 |
+
'year' => '1 година|:count години',
|
14 |
+
'y' => '1 година|:count години',
|
15 |
+
'month' => '1 месец|:count месеца',
|
16 |
+
'm' => '1 месец|:count месеца',
|
17 |
+
'week' => '1 седмица|:count седмици',
|
18 |
+
'w' => '1 седмица|:count седмици',
|
19 |
+
'day' => '1 ден|:count дни',
|
20 |
+
'd' => '1 ден|:count дни',
|
21 |
+
'hour' => '1 час|:count часа',
|
22 |
+
'h' => '1 час|:count часа',
|
23 |
+
'minute' => '1 минута|:count минути',
|
24 |
+
'm' => '1 минута|:count минути',
|
25 |
+
'second' => '1 секунда|:count секунди',
|
26 |
+
's' => '1 секунда|:count секунди',
|
27 |
+
'ago' => 'преди :time',
|
28 |
+
'from_now' => ':time от сега',
|
29 |
+
'after' => 'след :time',
|
30 |
+
'before' => 'преди :time',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/bn.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/eu/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '১ বছর|:count বছর',
|
14 |
+
'y' => '১ বছর|:count বছর',
|
15 |
+
'month' => '১ মাস|:count মাস',
|
16 |
+
'm' => '১ মাস|:count মাস',
|
17 |
+
'week' => '১ সপ্তাহ|:count সপ্তাহ',
|
18 |
+
'w' => '১ সপ্তাহ|:count সপ্তাহ',
|
19 |
+
'day' => '১ দিন|:count দিন',
|
20 |
+
'd' => '১ দিন|:count দিন',
|
21 |
+
'hour' => '১ ঘন্টা|:count ঘন্টা',
|
22 |
+
'h' => '১ ঘন্টা|:count ঘন্টা',
|
23 |
+
'minute' => '১ মিনিট|:count মিনিট',
|
24 |
+
'min' => '১ মিনিট|:count মিনিট',
|
25 |
+
'second' => '১ সেকেন্ড|:count সেকেন্ড',
|
26 |
+
's' => '১ সেকেন্ড|:count সেকেন্ড',
|
27 |
+
'ago' => ':time পূর্বে',
|
28 |
+
'from_now' => 'এখন থেকে :time',
|
29 |
+
'after' => ':time পরে',
|
30 |
+
'before' => ':time আগে',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/ca.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/ca/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 any|:count anys',
|
14 |
+
'y' => '1 any|:count anys',
|
15 |
+
'month' => '1 mes|:count mesos',
|
16 |
+
'm' => '1 mes|:count mesos',
|
17 |
+
'week' => '1 setmana|:count setmanes',
|
18 |
+
'w' => '1 setmana|:count setmanes',
|
19 |
+
'day' => '1 dia|:count dies',
|
20 |
+
'd' => '1 dia|:count dies',
|
21 |
+
'hour' => '1 hora|:count hores',
|
22 |
+
'h' => '1 hora|:count hores',
|
23 |
+
'minute' => '1 minut|:count minuts',
|
24 |
+
'min' => '1 minut|:count minuts',
|
25 |
+
'second' => '1 segon|:count segons',
|
26 |
+
's' => '1 segon|:count segons',
|
27 |
+
'ago' => 'fa :time',
|
28 |
+
'from_now' => 'dins de :time',
|
29 |
+
'after' => ':time després',
|
30 |
+
'before' => ':time abans',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/cs.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/cs/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 rok|:count roky|:count let',
|
14 |
+
'y' => '1 rok|:count roky|:count let',
|
15 |
+
'month' => '1 měsíc|:count měsíce|:count měsíců',
|
16 |
+
'm' => '1 měsíc|:count měsíce|:count měsíců',
|
17 |
+
'week' => '1 týden|:count týdny|:count týdnů',
|
18 |
+
'w' => '1 týden|:count týdny|:count týdnů',
|
19 |
+
'day' => '1 den|:count dny|:count dní',
|
20 |
+
'd' => '1 den|:count dny|:count dní',
|
21 |
+
'hour' => '1 hodinu|:count hodiny|:count hodin',
|
22 |
+
'h' => '1 hodinu|:count hodiny|:count hodin',
|
23 |
+
'minute' => '1 minutu|:count minuty|:count minut',
|
24 |
+
'min' => '1 minutu|:count minuty|:count minut',
|
25 |
+
'second' => '1 sekundu|:count sekundy|:count sekund',
|
26 |
+
's' => '1 sekundu|:count sekundy|:count sekund',
|
27 |
+
'ago' => ':time nazpět',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => ':time později',
|
30 |
+
'before' => ':time předtím',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/da.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 år|:count år',
|
14 |
+
'y' => '1 år|:count år',
|
15 |
+
'month' => '1 måned|:count måneder',
|
16 |
+
'm' => '1 måned|:count måneder',
|
17 |
+
'week' => '1 uge|:count uger',
|
18 |
+
'w' => '1 uge|:count uger',
|
19 |
+
'day' => '1 dag|:count dage',
|
20 |
+
'd' => '1 dag|:count dage',
|
21 |
+
'hour' => '1 time|:count timer',
|
22 |
+
'h' => '1 time|:count timer',
|
23 |
+
'minute' => '1 minut|:count minutter',
|
24 |
+
'min' => '1 minut|:count minutter',
|
25 |
+
'second' => '1 sekund|:count sekunder',
|
26 |
+
's' => '1 sekund|:count sekunder',
|
27 |
+
'ago' => ':time siden',
|
28 |
+
'from_now' => 'om :time',
|
29 |
+
'after' => ':time efter',
|
30 |
+
'before' => ':time før',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/de.php
CHANGED
@@ -3,29 +3,31 @@
|
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
6 |
-
* (c)
|
7 |
*
|
8 |
-
*
|
9 |
-
*
|
10 |
-
* any manner you want, without any copyright headers, notices, or other attribution.
|
11 |
*/
|
12 |
|
13 |
-
/**
|
14 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
15 |
-
* for possible formats.
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
'year_from_now' => '1 Jahr|:count Jahren',
|
31 |
'month_from_now' => '1 Monat|:count Monaten',
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
|
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 Jahr|:count Jahre',
|
14 |
+
'y' => '1J|:countJ',
|
15 |
+
'month' => '1 Monat|:count Monate',
|
16 |
+
'm' => '1Mon|:countMon',
|
17 |
+
'week' => '1 Woche|:count Wochen',
|
18 |
+
'w' => '1Wo|:countWo',
|
19 |
+
'day' => '1 Tag|:count Tage',
|
20 |
+
'd' => '1Tg|:countTg',
|
21 |
+
'hour' => '1 Stunde|:count Stunden',
|
22 |
+
'h' => '1Std|:countStd',
|
23 |
+
'minute' => '1 Minute|:count Minuten',
|
24 |
+
'min' => '1Min|:countMin',
|
25 |
+
'second' => '1 Sekunde|:count Sekunden',
|
26 |
+
's' => '1Sek|:countSek',
|
27 |
+
'ago' => 'vor :time',
|
28 |
+
'from_now' => 'in :time',
|
29 |
+
'after' => ':time später',
|
30 |
+
'before' => ':time zuvor',
|
31 |
|
32 |
'year_from_now' => '1 Jahr|:count Jahren',
|
33 |
'month_from_now' => '1 Monat|:count Monaten',
|
vendor/nesbot/carbon/src/Carbon/Lang/el.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/el/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 χρόνος|:count χρόνια',
|
14 |
+
'y' => '1 χρόνος|:count χρόνια',
|
15 |
+
'month' => '1 μήνας|:count μήνες',
|
16 |
+
'm' => '1 μήνας|:count μήνες',
|
17 |
+
'week' => '1 εβδομάδα|:count εβδομάδες',
|
18 |
+
'w' => '1 εβδομάδα|:count εβδομάδες',
|
19 |
+
'day' => '1 μέρα|:count μέρες',
|
20 |
+
'd' => '1 μέρα|:count μέρες',
|
21 |
+
'hour' => '1 ώρα|:count ώρες',
|
22 |
+
'h' => '1 ώρα|:count ώρες',
|
23 |
+
'minute' => '1 λεπτό|:count λεπτά',
|
24 |
+
'min' => '1 λεπτό|:count λεπτά',
|
25 |
+
'second' => '1 δευτερόλεπτο|:count δευτερόλεπτα',
|
26 |
+
's' => '1 δευτερόλεπτο|:count δευτερόλεπτα',
|
27 |
+
'ago' => 'πρίν απο :time',
|
28 |
+
'from_now' => 'σε :time απο τώρα',
|
29 |
+
'after' => ':time μετά',
|
30 |
+
'before' => ':time πρίν',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/en.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 year|:count years',
|
14 |
+
'y' => '1yr|:countyrs',
|
15 |
+
'month' => '1 month|:count months',
|
16 |
+
'm' => '1mo|:countmos',
|
17 |
+
'week' => '1 week|:count weeks',
|
18 |
+
'w' => '1w|:countw',
|
19 |
+
'day' => '1 day|:count days',
|
20 |
+
'd' => '1d|:countd',
|
21 |
+
'hour' => '1 hour|:count hours',
|
22 |
+
'h' => '1h|:counth',
|
23 |
+
'minute' => '1 minute|:count minutes',
|
24 |
+
'min' => '1m|:countm',
|
25 |
+
'second' => '1 second|:count seconds',
|
26 |
+
's' => '1s|:counts',
|
27 |
+
'ago' => ':time ago',
|
28 |
+
'from_now' => ':time from now',
|
29 |
+
'after' => ':time after',
|
30 |
+
'before' => ':time before',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/eo.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/eo/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 jaro|:count jaroj',
|
14 |
+
'y' => '1 jaro|:count jaroj',
|
15 |
+
'month' => '1 monato|:count monatoj',
|
16 |
+
'm' => '1 monato|:count monatoj',
|
17 |
+
'week' => '1 semajno|:count semajnoj',
|
18 |
+
'w' => '1 semajno|:count semajnoj',
|
19 |
+
'day' => '1 tago|:count tagoj',
|
20 |
+
'd' => '1 tago|:count tagoj',
|
21 |
+
'hour' => '1 horo|:count horoj',
|
22 |
+
'h' => '1 horo|:count horoj',
|
23 |
+
'minute' => '1 minuto|:count minutoj',
|
24 |
+
'min' => '1 minuto|:count minutoj',
|
25 |
+
'second' => '1 sekundo|:count sekundoj',
|
26 |
+
's' => '1 sekundo|:count sekundoj',
|
27 |
+
'ago' => 'antaŭ :time',
|
28 |
+
'from_now' => 'je :time',
|
29 |
+
'after' => ':time poste',
|
30 |
+
'before' => ':time antaŭe',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/es.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 año|:count años',
|
14 |
+
'y' => '1 año|:count años',
|
15 |
+
'month' => '1 mes|:count meses',
|
16 |
+
'm' => '1 mes|:count meses',
|
17 |
+
'week' => '1 semana|:count semanas',
|
18 |
+
'w' => '1 semana|:count semanas',
|
19 |
+
'day' => '1 día|:count días',
|
20 |
+
'd' => '1 día|:count días',
|
21 |
+
'hour' => '1 hora|:count horas',
|
22 |
+
'h' => '1 hora|:count horas',
|
23 |
+
'minute' => '1 minuto|:count minutos',
|
24 |
+
'min' => '1 minuto|:count minutos',
|
25 |
+
'second' => '1 segundo|:count segundos',
|
26 |
+
's' => '1 segundo|:count segundos',
|
27 |
+
'ago' => 'hace :time',
|
28 |
+
'from_now' => 'dentro de :time',
|
29 |
+
'after' => ':time después',
|
30 |
+
'before' => ':time antes',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/et.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -6,20 +7,27 @@
|
|
6 |
*
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
-
*
|
10 |
*/
|
|
|
11 |
return array(
|
12 |
-
'year'
|
13 |
-
'
|
14 |
-
'
|
15 |
-
'
|
16 |
-
'
|
17 |
-
'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
'year_from_now' => ':count aasta',
|
24 |
'month_from_now' => ':count kuu',
|
25 |
'week_from_now' => ':count nädala',
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
|
|
10 |
*/
|
11 |
+
|
12 |
return array(
|
13 |
+
'year' => '1 aasta|:count aastat',
|
14 |
+
'y' => '1 aasta|:count aastat',
|
15 |
+
'month' => '1 kuu|:count kuud',
|
16 |
+
'm' => '1 kuu|:count kuud',
|
17 |
+
'week' => '1 nädal|:count nädalat',
|
18 |
+
'w' => '1 nädal|:count nädalat',
|
19 |
+
'day' => '1 päev|:count päeva',
|
20 |
+
'd' => '1 päev|:count päeva',
|
21 |
+
'hour' => '1 tund|:count tundi',
|
22 |
+
'h' => '1 tund|:count tundi',
|
23 |
+
'minute' => '1 minut|:count minutit',
|
24 |
+
'min' => '1 minut|:count minutit',
|
25 |
+
'second' => '1 sekund|:count sekundit',
|
26 |
+
's' => '1 sekund|:count sekundit',
|
27 |
+
'ago' => ':time tagasi',
|
28 |
+
'from_now' => ':time pärast',
|
29 |
+
'after' => ':time pärast',
|
30 |
+
'before' => ':time enne',
|
31 |
'year_from_now' => ':count aasta',
|
32 |
'month_from_now' => ':count kuu',
|
33 |
'week_from_now' => ':count nädala',
|
vendor/nesbot/carbon/src/Carbon/Lang/eu.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/eu/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => 'Urte 1|:count urte',
|
14 |
+
'y' => 'Urte 1|:count urte',
|
15 |
+
'month' => 'Hile 1|:count hile',
|
16 |
+
'm' => 'Hile 1|:count hile',
|
17 |
+
'week' => 'Aste 1|:count aste',
|
18 |
+
'w' => 'Aste 1|:count aste',
|
19 |
+
'day' => 'Egun 1|:count egun',
|
20 |
+
'd' => 'Egun 1|:count egun',
|
21 |
+
'hour' => 'Ordu 1|:count ordu',
|
22 |
+
'h' => 'Ordu 1|:count ordu',
|
23 |
+
'minute' => 'Minutu 1|:count minutu',
|
24 |
+
'min' => 'Minutu 1|:count minutu',
|
25 |
+
'second' => 'Segundu 1|:count segundu',
|
26 |
+
's' => 'Segundu 1|:count segundu',
|
27 |
+
'ago' => 'Orain dela :time',
|
28 |
+
'from_now' => ':time barru',
|
29 |
+
'after' => ':time geroago',
|
30 |
+
'before' => ':time lehenago',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/fa.php
CHANGED
@@ -9,21 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
-
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count سال',
|
14 |
+
'y' => ':count سال',
|
15 |
+
'month' => ':count ماه',
|
16 |
+
'm' => ':count ماه',
|
17 |
+
'week' => ':count هفته',
|
18 |
+
'w' => ':count هفته',
|
19 |
+
'day' => ':count روز',
|
20 |
+
'd' => ':count روز',
|
21 |
+
'hour' => ':count ساعت',
|
22 |
+
'h' => ':count ساعت',
|
23 |
+
'minute' => ':count دقیقه',
|
24 |
+
'min' => ':count دقیقه',
|
25 |
+
'second' => ':count ثانیه',
|
26 |
+
's' => ':count ثانیه',
|
27 |
+
'ago' => ':time پیش',
|
28 |
+
'from_now' => ':time بعد',
|
29 |
+
'after' => ':time پس از',
|
30 |
+
'before' => ':time پیش از',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/fi.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/fi/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 vuosi|:count vuotta',
|
14 |
+
'y' => '1 vuosi|:count vuotta',
|
15 |
+
'month' => '1 kuukausi|:count kuukautta',
|
16 |
+
'm' => '1 kuukausi|:count kuukautta',
|
17 |
+
'week' => '1 viikko|:count viikkoa',
|
18 |
+
'w' => '1 viikko|:count viikkoa',
|
19 |
+
'day' => '1 päivä|:count päivää',
|
20 |
+
'd' => '1 päivä|:count päivää',
|
21 |
+
'hour' => '1 tunti|:count tuntia',
|
22 |
+
'h' => '1 tunti|:count tuntia',
|
23 |
+
'minute' => '1 minuutti|:count minuuttia',
|
24 |
+
'min' => '1 minuutti|:count minuuttia',
|
25 |
+
'second' => '1 sekunti|:count sekuntia',
|
26 |
+
's' => '1 sekunti|:count sekuntia',
|
27 |
+
'ago' => ':time sitten',
|
28 |
+
'from_now' => ':time tästä hetkestä',
|
29 |
+
'after' => ':time sen jälkeen',
|
30 |
+
'before' => ':time ennen',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/fo.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 ár|:count ár',
|
14 |
+
'y' => '1 ár|:count ár',
|
15 |
+
'month' => '1 mánaður|:count mánaðir',
|
16 |
+
'm' => '1 mánaður|:count mánaðir',
|
17 |
+
'week' => '1 vika|:count vikur',
|
18 |
+
'w' => '1 vika|:count vikur',
|
19 |
+
'day' => '1 dag|:count dagar',
|
20 |
+
'd' => '1 dag|:count dagar',
|
21 |
+
'hour' => '1 tími|:count tímar',
|
22 |
+
'h' => '1 tími|:count tímar',
|
23 |
+
'minute' => '1 minutt|:count minuttir',
|
24 |
+
'min' => '1 minutt|:count minuttir',
|
25 |
+
'second' => '1 sekund|:count sekundir',
|
26 |
+
's' => '1 sekund|:count sekundir',
|
27 |
+
'ago' => ':time síðan',
|
28 |
+
'from_now' => 'um :time',
|
29 |
+
'after' => ':time aftaná',
|
30 |
+
'before' => ':time áðrenn',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/fr.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 an|:count ans',
|
14 |
+
'y' => '1 an|:count ans',
|
15 |
+
'month' => ':count mois',
|
16 |
+
'm' => ':count mois',
|
17 |
+
'week' => '1 semaine|:count semaines',
|
18 |
+
'w' => '1 semaine|:count semaines',
|
19 |
+
'day' => '1 jour|:count jours',
|
20 |
+
'd' => '1 jour|:count jours',
|
21 |
+
'hour' => '1 heure|:count heures',
|
22 |
+
'h' => '1 heure|:count heures',
|
23 |
+
'minute' => '1 minute|:count minutes',
|
24 |
+
'min' => '1 minute|:count minutes',
|
25 |
+
'second' => '1 seconde|:count secondes',
|
26 |
+
's' => '1 seconde|:count secondes',
|
27 |
+
'ago' => 'il y a :time',
|
28 |
+
'from_now' => 'dans :time',
|
29 |
+
'after' => ':time après',
|
30 |
+
'before' => ':time avant',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/gl.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 ano|:count anos',
|
14 |
+
'month' => '1 mes|:count meses',
|
15 |
+
'week' => '1 semana|:count semanas',
|
16 |
+
'day' => '1 día|:count días',
|
17 |
+
'hour' => '1 hora|:count horas',
|
18 |
+
'minute' => '1 minuto|:count minutos',
|
19 |
+
'second' => '1 segundo|:count segundos',
|
20 |
+
'ago' => 'fai :time',
|
21 |
+
'from_now' => 'dentro de :time',
|
22 |
+
'after' => ':time despois',
|
23 |
+
'before' => ':time antes',
|
24 |
+
);
|
vendor/nesbot/carbon/src/Carbon/Lang/he.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => 'שנה|{2}שנתיים|:count שנים',
|
14 |
+
'y' => 'שנה|{2}שנתיים|:count שנים',
|
15 |
+
'month' => 'חודש|{2}חודשיים|:count חודשים',
|
16 |
+
'm' => 'חודש|{2}חודשיים|:count חודשים',
|
17 |
+
'week' => 'שבוע|{2}שבועיים|:count שבועות',
|
18 |
+
'w' => 'שבוע|{2}שבועיים|:count שבועות',
|
19 |
+
'day' => 'יום|{2}יומיים|:count ימים',
|
20 |
+
'd' => 'יום|{2}יומיים|:count ימים',
|
21 |
+
'hour' => 'שעה|{2}שעתיים|:count שעות',
|
22 |
+
'h' => 'שעה|{2}שעתיים|:count שעות',
|
23 |
+
'minute' => 'דקה|{2}דקותיים|:count דקות',
|
24 |
+
'min' => 'דקה|{2}דקותיים|:count דקות',
|
25 |
+
'second' => 'שניה|:count שניות',
|
26 |
+
's' => 'שניה|:count שניות',
|
27 |
+
'ago' => 'לפני :time',
|
28 |
+
'from_now' => 'בעוד :time',
|
29 |
+
'after' => 'אחרי :time',
|
30 |
+
'before' => 'לפני :time',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/hr.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/hr/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count godinu|:count godine|:count godina',
|
14 |
+
'y' => ':count godinu|:count godine|:count godina',
|
15 |
+
'month' => ':count mjesec|:count mjeseca|:count mjeseci',
|
16 |
+
'm' => ':count mjesec|:count mjeseca|:count mjeseci',
|
17 |
+
'week' => ':count tjedan|:count tjedna|:count tjedana',
|
18 |
+
'w' => ':count tjedan|:count tjedna|:count tjedana',
|
19 |
+
'day' => ':count dan|:count dana|:count dana',
|
20 |
+
'd' => ':count dan|:count dana|:count dana',
|
21 |
+
'hour' => ':count sat|:count sata|:count sati',
|
22 |
+
'h' => ':count sat|:count sata|:count sati',
|
23 |
+
'minute' => ':count minutu|:count minute |:count minuta',
|
24 |
+
'min' => ':count minutu|:count minute |:count minuta',
|
25 |
+
'second' => ':count sekundu|:count sekunde|:count sekundi',
|
26 |
+
's' => ':count sekundu|:count sekunde|:count sekundi',
|
27 |
+
'ago' => 'prije :time',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => 'za :time',
|
30 |
+
'before' => 'prije :time',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/hu.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,45 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/hu/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count év',
|
14 |
+
'y' => ':count év',
|
15 |
+
'month' => ':count hónap',
|
16 |
+
'm' => ':count hónap',
|
17 |
+
'week' => ':count hét',
|
18 |
+
'w' => ':count hét',
|
19 |
+
'day' => ':count nap',
|
20 |
+
'd' => ':count nap',
|
21 |
+
'hour' => ':count óra',
|
22 |
+
'h' => ':count óra',
|
23 |
+
'minute' => ':count perc',
|
24 |
+
'min' => ':count perc',
|
25 |
+
'second' => ':count másodperc',
|
26 |
+
's' => ':count másodperc',
|
27 |
+
'ago' => ':time',
|
28 |
+
'from_now' => ':time múlva',
|
29 |
+
'after' => ':time később',
|
30 |
+
'before' => ':time korábban',
|
31 |
+
'year_ago' => ':count éve',
|
32 |
+
'month_ago' => ':count hónapja',
|
33 |
+
'week_ago' => ':count hete',
|
34 |
+
'day_ago' => ':count napja',
|
35 |
+
'hour_ago' => ':count órája',
|
36 |
+
'minute_ago' => ':count perce',
|
37 |
+
'second_ago' => ':count másodperce',
|
38 |
+
'year_after' => ':count évvel',
|
39 |
+
'month_after' => ':count hónappal',
|
40 |
+
'week_after' => ':count héttel',
|
41 |
+
'day_after' => ':count nappal',
|
42 |
+
'hour_after' => ':count órával',
|
43 |
+
'minute_after' => ':count perccel',
|
44 |
+
'second_after' => ':count másodperccel',
|
45 |
+
'year_before' => ':count évvel',
|
46 |
+
'month_before' => ':count hónappal',
|
47 |
+
'week_before' => ':count héttel',
|
48 |
+
'day_before' => ':count nappal',
|
49 |
+
'hour_before' => ':count órával',
|
50 |
+
'minute_before' => ':count perccel',
|
51 |
+
'second_before' => ':count másodperccel',
|
52 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/hy.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count տարի',
|
14 |
+
'y' => ':count տարի',
|
15 |
+
'month' => ':count ամիս',
|
16 |
+
'm' => ':count ամիս',
|
17 |
+
'week' => ':count շաբաթ',
|
18 |
+
'w' => ':count շաբաթ',
|
19 |
+
'day' => ':count օր',
|
20 |
+
'd' => ':count օր',
|
21 |
+
'hour' => ':count ժամ',
|
22 |
+
'h' => ':count ժամ',
|
23 |
+
'minute' => ':count րոպե',
|
24 |
+
'min' => ':count րոպե',
|
25 |
+
'second' => ':count վայրկյան',
|
26 |
+
's' => ':count վայրկյան',
|
27 |
+
'ago' => ':time առաջ',
|
28 |
+
'from_now' => ':time հետո',
|
29 |
+
'after' => ':time հետո',
|
30 |
+
'before' => ':time առաջ',
|
31 |
+
);
|
vendor/nesbot/carbon/src/Carbon/Lang/id.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/id/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count tahun',
|
14 |
+
'y' => ':count tahun',
|
15 |
+
'month' => ':count bulan',
|
16 |
+
'm' => ':count bulan',
|
17 |
+
'week' => ':count minggu',
|
18 |
+
'w' => ':count minggu',
|
19 |
+
'day' => ':count hari',
|
20 |
+
'd' => ':count hari',
|
21 |
+
'hour' => ':count jam',
|
22 |
+
'h' => ':count jam',
|
23 |
+
'minute' => ':count menit',
|
24 |
+
'min' => ':count menit',
|
25 |
+
'second' => ':count detik',
|
26 |
+
's' => ':count detik',
|
27 |
+
'ago' => ':time yang lalu',
|
28 |
+
'from_now' => ':time dari sekarang',
|
29 |
+
'after' => ':time setelah',
|
30 |
+
'before' => ':time sebelum',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/it.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 anno|:count anni',
|
14 |
+
'y' => '1 anno|:count anni',
|
15 |
+
'month' => '1 mese|:count mesi',
|
16 |
+
'm' => '1 mese|:count mesi',
|
17 |
+
'week' => '1 settimana|:count settimane',
|
18 |
+
'w' => '1 settimana|:count settimane',
|
19 |
+
'day' => '1 giorno|:count giorni',
|
20 |
+
'd' => '1 giorno|:count giorni',
|
21 |
+
'hour' => '1 ora|:count ore',
|
22 |
+
'h' => '1 ora|:count ore',
|
23 |
+
'minute' => '1 minuto|:count minuti',
|
24 |
+
'min' => '1 minuto|:count minuti',
|
25 |
+
'second' => '1 secondo|:count secondi',
|
26 |
+
's' => '1 secondo|:count secondi',
|
27 |
+
'ago' => ':time fa',
|
28 |
+
'from_now' => ':time da adesso',
|
29 |
+
'after' => ':time dopo',
|
30 |
+
'before' => ':time prima',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/ja.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/ja/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count 年',
|
14 |
+
'y' => ':count 年',
|
15 |
+
'month' => ':count ヶ月',
|
16 |
+
'm' => ':count ヶ月',
|
17 |
+
'week' => ':count 週間',
|
18 |
+
'w' => ':count 週間',
|
19 |
+
'day' => ':count 日',
|
20 |
+
'd' => ':count 日',
|
21 |
+
'hour' => ':count 時間',
|
22 |
+
'h' => ':count 時間',
|
23 |
+
'minute' => ':count 分',
|
24 |
+
'min' => ':count 分',
|
25 |
+
'second' => ':count 秒',
|
26 |
+
's' => ':count 秒',
|
27 |
+
'ago' => ':time 前',
|
28 |
+
'from_now' => '今から :time',
|
29 |
+
'after' => ':time 後',
|
30 |
+
'before' => ':time 前',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/ka.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count წლის',
|
14 |
+
'y' => ':count წლის',
|
15 |
+
'month' => ':count თვის',
|
16 |
+
'm' => ':count თვის',
|
17 |
+
'week' => ':count კვირის',
|
18 |
+
'w' => ':count კვირის',
|
19 |
+
'day' => ':count დღის',
|
20 |
+
'd' => ':count დღის',
|
21 |
+
'hour' => ':count საათის',
|
22 |
+
'h' => ':count საათის',
|
23 |
+
'minute' => ':count წუთის',
|
24 |
+
'min' => ':count წუთის',
|
25 |
+
'second' => ':count წამის',
|
26 |
+
's' => ':count წამის',
|
27 |
+
'ago' => ':time უკან',
|
28 |
+
'from_now' => ':time შემდეგ',
|
29 |
+
'after' => ':time შემდეგ',
|
30 |
+
'before' => ':time უკან',
|
31 |
+
);
|
vendor/nesbot/carbon/src/Carbon/Lang/km.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count ឆ្នាំ',
|
14 |
+
'y' => ':count ឆ្នាំ',
|
15 |
+
'month' => ':count ខែ',
|
16 |
+
'm' => ':count ខែ',
|
17 |
+
'week' => ':count សប្ដាហ៍',
|
18 |
+
'w' => ':count សប្ដាហ៍',
|
19 |
+
'day' => ':count ថ្ងៃ',
|
20 |
+
'd' => ':count ថ្ងៃ',
|
21 |
+
'hour' => ':count ម៉ោង',
|
22 |
+
'h' => ':count ម៉ោង',
|
23 |
+
'minute' => ':count នាទី',
|
24 |
+
'min' => ':count នាទី',
|
25 |
+
'second' => ':count វិនាទី',
|
26 |
+
's' => ':count វិនាទី',
|
27 |
+
'ago' => ':timeមុន',
|
28 |
+
'from_now' => ':timeពីឥឡូវ',
|
29 |
+
'after' => 'នៅក្រោយ :time',
|
30 |
+
'before' => 'នៅមុន :time',
|
31 |
+
);
|
vendor/nesbot/carbon/src/Carbon/Lang/ko.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/cs/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count 년',
|
14 |
+
'y' => ':count 년',
|
15 |
+
'month' => ':count 개월',
|
16 |
+
'm' => ':count 개월',
|
17 |
+
'week' => ':count 주일',
|
18 |
+
'w' => ':count 주일',
|
19 |
+
'day' => ':count 일',
|
20 |
+
'd' => ':count 일',
|
21 |
+
'hour' => ':count 시간',
|
22 |
+
'h' => ':count 시간',
|
23 |
+
'minute' => ':count 분',
|
24 |
+
'min' => ':count 분',
|
25 |
+
'second' => ':count 초',
|
26 |
+
's' => ':count 초',
|
27 |
+
'ago' => ':time 전',
|
28 |
+
'from_now' => ':time 후',
|
29 |
+
'after' => ':time 뒤',
|
30 |
+
'before' => ':time 앞',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/lt.php
CHANGED
@@ -9,21 +9,30 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
-
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count metus|:count metus|:count metų',
|
14 |
+
'y' => ':count metus|:count metus|:count metų',
|
15 |
+
'month' => ':count mėnesį|:count mėnesius|:count mėnesių',
|
16 |
+
'm' => ':count mėnesį|:count mėnesius|:count mėnesių',
|
17 |
+
'week' => ':count savaitę|:count savaites|:count savaičių',
|
18 |
+
'w' => ':count savaitę|:count savaites|:count savaičių',
|
19 |
+
'day' => ':count dieną|:count dienas|:count dienų',
|
20 |
+
'd' => ':count dieną|:count dienas|:count dienų',
|
21 |
+
'hour' => ':count valandą|:count valandas|:count valandų',
|
22 |
+
'h' => ':count valandą|:count valandas|:count valandų',
|
23 |
+
'minute' => ':count minutę|:count minutes|:count minučių',
|
24 |
+
'min' => ':count minutę|:count minutes|:count minučių',
|
25 |
+
'second' => ':count sekundę|:count sekundes|:count sekundžių',
|
26 |
+
's' => ':count sekundę|:count sekundes|:count sekundžių',
|
27 |
+
'second_from_now' => ':count sekundės|:count sekundžių|:count sekundžių',
|
28 |
+
'minute_from_now' => ':count minutės|:count minučių|:count minučių',
|
29 |
+
'hour_from_now' => ':count valandos|:count valandų|:count valandų',
|
30 |
+
'day_from_now' => ':count dienos|:count dienų|:count dienų',
|
31 |
+
'week_from_now' => ':count savaitės|:count savaičių|:count savaičių',
|
32 |
+
'month_from_now' => ':count mėnesio|:count mėnesių|:count mėnesių',
|
33 |
+
'year_from_now' => ':count metų',
|
34 |
+
'ago' => 'prieš :time',
|
35 |
+
'from_now' => 'už :time',
|
36 |
+
'after' => 'po :time',
|
37 |
+
'before' => ':time nuo dabar',
|
38 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/lv.php
CHANGED
@@ -1,43 +1,47 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
5 |
-
* (c)
|
6 |
*
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
|
11 |
-
/**
|
12 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
13 |
-
* for possible formats.
|
14 |
-
*/
|
15 |
return array(
|
16 |
-
'year'
|
17 |
-
'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
'year_after'
|
29 |
-
'month_after'
|
30 |
-
'week_after'
|
31 |
-
'day_after'
|
32 |
-
'hour_after'
|
33 |
-
'minute_after'
|
34 |
-
'second_after'
|
35 |
|
36 |
-
'year_before'
|
37 |
-
'month_before'
|
38 |
-
'week_before'
|
39 |
-
'day_before'
|
40 |
-
'hour_before'
|
41 |
'minute_before' => '0 minūtes|:count minūti|:count minūtes',
|
42 |
'second_before' => '0 sekundes|:count sekundi|:count sekundes',
|
43 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '0 gadiem|:count gada|:count gadiem',
|
14 |
+
'y' => '0 gadiem|:count gada|:count gadiem',
|
15 |
+
'month' => '0 mēnešiem|:count mēneša|:count mēnešiem',
|
16 |
+
'm' => '0 mēnešiem|:count mēneša|:count mēnešiem',
|
17 |
+
'week' => '0 nedēļām|:count nedēļas|:count nedēļām',
|
18 |
+
'w' => '0 nedēļām|:count nedēļas|:count nedēļām',
|
19 |
+
'day' => '0 dienām|:count dienas|:count dienām',
|
20 |
+
'd' => '0 dienām|:count dienas|:count dienām',
|
21 |
+
'hour' => '0 stundām|:count stundas|:count stundām',
|
22 |
+
'h' => '0 stundām|:count stundas|:count stundām',
|
23 |
+
'minute' => '0 minūtēm|:count minūtes|:count minūtēm',
|
24 |
+
'min' => '0 minūtēm|:count minūtes|:count minūtēm',
|
25 |
+
'second' => '0 sekundēm|:count sekundes|:count sekundēm',
|
26 |
+
's' => '0 sekundēm|:count sekundes|:count sekundēm',
|
27 |
+
'ago' => 'pirms :time',
|
28 |
+
'from_now' => 'pēc :time',
|
29 |
+
'after' => ':time vēlāk',
|
30 |
+
'before' => ':time pirms',
|
31 |
|
32 |
+
'year_after' => '0 gadus|:count gadu|:count gadus',
|
33 |
+
'month_after' => '0 mēnešus|:count mēnesi|:count mēnešus',
|
34 |
+
'week_after' => '0 nedēļas|:count nedēļu|:count nedēļas',
|
35 |
+
'day_after' => '0 dienas|:count dienu|:count dienas',
|
36 |
+
'hour_after' => '0 stundas|:count stundu|:count stundas',
|
37 |
+
'minute_after' => '0 minūtes|:count minūti|:count minūtes',
|
38 |
+
'second_after' => '0 sekundes|:count sekundi|:count sekundes',
|
39 |
|
40 |
+
'year_before' => '0 gadus|:count gadu|:count gadus',
|
41 |
+
'month_before' => '0 mēnešus|:count mēnesi|:count mēnešus',
|
42 |
+
'week_before' => '0 nedēļas|:count nedēļu|:count nedēļas',
|
43 |
+
'day_before' => '0 dienas|:count dienu|:count dienas',
|
44 |
+
'hour_before' => '0 stundas|:count stundu|:count stundas',
|
45 |
'minute_before' => '0 minūtes|:count minūti|:count minūtes',
|
46 |
'second_before' => '0 sekundes|:count sekundi|:count sekundes',
|
47 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/mk.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '1 година|:count години',
|
14 |
+
'month' => '1 месец|:count месеци',
|
15 |
+
'week' => '1 седмица|:count седмици',
|
16 |
+
'day' => '1 ден|:count дена',
|
17 |
+
'hour' => '1 час|:count часа',
|
18 |
+
'minute' => '1 минута|:count минути',
|
19 |
+
'second' => '1 секунда|:count секунди',
|
20 |
+
'ago' => 'пред :time',
|
21 |
+
'from_now' => ':time од сега',
|
22 |
+
'after' => 'по :time',
|
23 |
+
'before' => 'пред :time',
|
24 |
+
);
|
vendor/nesbot/carbon/src/Carbon/Lang/ms.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,20 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
return array(
|
15 |
-
'year'
|
16 |
-
'
|
17 |
-
'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count tahun',
|
14 |
+
'y' => ':count tahun',
|
15 |
+
'month' => ':count bulan',
|
16 |
+
'm' => ':count bulan',
|
17 |
+
'week' => ':count minggu',
|
18 |
+
'w' => ':count minggu',
|
19 |
+
'day' => ':count hari',
|
20 |
+
'd' => ':count hari',
|
21 |
+
'hour' => ':count jam',
|
22 |
+
'h' => ':count jam',
|
23 |
+
'minute' => ':count minit',
|
24 |
+
'min' => ':count minit',
|
25 |
+
'second' => ':count saat',
|
26 |
+
's' => ':count saat',
|
27 |
+
'ago' => ':time yang lalu',
|
28 |
+
'from_now' => ':time dari sekarang',
|
29 |
+
'after' => ':time selepas',
|
30 |
+
'before' => ':time sebelum',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/nl.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,20 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
return array(
|
15 |
-
'year'
|
16 |
-
'
|
17 |
-
'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count jaar',
|
14 |
+
'y' => ':count jaar',
|
15 |
+
'month' => '1 maand|:count maanden',
|
16 |
+
'm' => '1 maand|:count maanden',
|
17 |
+
'week' => '1 week|:count weken',
|
18 |
+
'w' => '1 week|:count weken',
|
19 |
+
'day' => '1 dag|:count dagen',
|
20 |
+
'd' => '1 dag|:count dagen',
|
21 |
+
'hour' => ':count uur',
|
22 |
+
'h' => ':count uur',
|
23 |
+
'minute' => '1 minuut|:count minuten',
|
24 |
+
'min' => '1 minuut|:count minuten',
|
25 |
+
'second' => '1 seconde|:count seconden',
|
26 |
+
's' => '1 seconde|:count seconden',
|
27 |
+
'ago' => ':time geleden',
|
28 |
+
'from_now' => 'over :time',
|
29 |
+
'after' => ':time later',
|
30 |
+
'before' => ':time eerder',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/no.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/no/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 år|:count år',
|
14 |
+
'y' => '1 år|:count år',
|
15 |
+
'month' => '1 måned|:count måneder',
|
16 |
+
'm' => '1 måned|:count måneder',
|
17 |
+
'week' => '1 uke|:count uker',
|
18 |
+
'w' => '1 uke|:count uker',
|
19 |
+
'day' => '1 dag|:count dager',
|
20 |
+
'd' => '1 dag|:count dager',
|
21 |
+
'hour' => '1 time|:count timer',
|
22 |
+
'h' => '1 time|:count timer',
|
23 |
+
'minute' => '1 minutt|:count minutter',
|
24 |
+
'min' => '1 minutt|:count minutter',
|
25 |
+
'second' => '1 sekund|:count sekunder',
|
26 |
+
's' => '1 sekund|:count sekunder',
|
27 |
+
'ago' => ':time siden',
|
28 |
+
'from_now' => 'om :time',
|
29 |
+
'after' => ':time etter',
|
30 |
+
'before' => ':time før',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/pl.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/pl/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 rok|:count lata|:count lat',
|
14 |
+
'y' => '1 rok|:count lata|:count lat',
|
15 |
+
'month' => '1 miesiąc|:count miesiące|:count miesięcy',
|
16 |
+
'm' => '1 miesiąc|:count miesiące|:count miesięcy',
|
17 |
+
'week' => '1 tydzień|:count tygodnie|:count tygodni',
|
18 |
+
'w' => '1 tydzień|:count tygodnie|:count tygodni',
|
19 |
+
'day' => '1 dzień|:count dni|:count dni',
|
20 |
+
'd' => '1 dzień|:count dni|:count dni',
|
21 |
+
'hour' => '1 godzina|:count godziny|:count godzin',
|
22 |
+
'h' => '1 godzina|:count godziny|:count godzin',
|
23 |
+
'minute' => '1 minuta|:count minuty|:count minut',
|
24 |
+
'min' => '1 minuta|:count minuty|:count minut',
|
25 |
+
'second' => '1 sekunda|:count sekundy|:count sekund',
|
26 |
+
's' => '1 sekunda|:count sekundy|:count sekund',
|
27 |
+
'ago' => ':time temu',
|
28 |
+
'from_now' => ':time od teraz',
|
29 |
+
'after' => ':time przed',
|
30 |
+
'before' => ':time po',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/pt.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/pt/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 ano|:count anos',
|
14 |
+
'y' => '1 ano|:count anos',
|
15 |
+
'month' => '1 mês|:count meses',
|
16 |
+
'm' => '1 mês|:count meses',
|
17 |
+
'week' => '1 semana|:count semanas',
|
18 |
+
'w' => '1 semana|:count semanas',
|
19 |
+
'day' => '1 dia|:count dias',
|
20 |
+
'd' => '1 dia|:count dias',
|
21 |
+
'hour' => '1 hora|:count horas',
|
22 |
+
'h' => '1 hora|:count horas',
|
23 |
+
'minute' => '1 minuto|:count minutos',
|
24 |
+
'min' => '1 minuto|:count minutos',
|
25 |
+
'second' => '1 segundo|:count segundos',
|
26 |
+
's' => '1 segundo|:count segundos',
|
27 |
+
'ago' => ':time atrás',
|
28 |
+
'from_now' => 'em :time',
|
29 |
+
'after' => ':time depois',
|
30 |
+
'before' => ':time antes',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/pt_BR.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,20 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
return array(
|
15 |
-
'year'
|
16 |
-
'
|
17 |
-
'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 ano|:count anos',
|
14 |
+
'y' => '1 ano|:count anos',
|
15 |
+
'month' => '1 mês|:count meses',
|
16 |
+
'm' => '1 mês|:count meses',
|
17 |
+
'week' => '1 semana|:count semanas',
|
18 |
+
'w' => '1 semana|:count semanas',
|
19 |
+
'day' => '1 dia|:count dias',
|
20 |
+
'd' => '1 dia|:count dias',
|
21 |
+
'hour' => '1 hora|:count horas',
|
22 |
+
'h' => '1 hora|:count horas',
|
23 |
+
'minute' => '1 minuto|:count minutos',
|
24 |
+
'min' => '1 minuto|:count minutos',
|
25 |
+
'second' => '1 segundo|:count segundos',
|
26 |
+
's' => '1 segundo|:count segundos',
|
27 |
+
'ago' => 'há :time',
|
28 |
+
'from_now' => 'em :time',
|
29 |
+
'after' => 'após :time',
|
30 |
+
'before' => ':time atrás',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/ro.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/ro/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => 'un an|:count ani|:count ani',
|
14 |
+
'y' => 'un an|:count ani|:count ani',
|
15 |
+
'month' => 'o lună|:count luni|:count luni',
|
16 |
+
'm' => 'o lună|:count luni|:count luni',
|
17 |
+
'week' => 'o săptămână|:count săptămâni|:count săptămâni',
|
18 |
+
'w' => 'o săptămână|:count săptămâni|:count săptămâni',
|
19 |
+
'day' => 'o zi|:count zile|:count zile',
|
20 |
+
'd' => 'o zi|:count zile|:count zile',
|
21 |
+
'hour' => 'o oră|:count ore|:count ore',
|
22 |
+
'h' => 'o oră|:count ore|:count ore',
|
23 |
+
'minute' => 'un minut|:count minute|:count minute',
|
24 |
+
'min' => 'un minut|:count minute|:count minute',
|
25 |
+
'second' => 'o secundă|:count secunde|:count secunde',
|
26 |
+
's' => 'o secundă|:count secunde|:count secunde',
|
27 |
+
'ago' => 'acum :time',
|
28 |
+
'from_now' => ':time de acum',
|
29 |
+
'after' => 'peste :time',
|
30 |
+
'before' => 'acum :time',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/ru.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/ru/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count год|:count года|:count лет',
|
14 |
+
'y' => ':count год|:count года|:count лет',
|
15 |
+
'month' => ':count месяц|:count месяца|:count месяцев',
|
16 |
+
'm' => ':count месяц|:count месяца|:count месяцев',
|
17 |
+
'week' => ':count неделю|:count недели|:count недель',
|
18 |
+
'w' => ':count неделю|:count недели|:count недель',
|
19 |
+
'day' => ':count день|:count дня|:count дней',
|
20 |
+
'd' => ':count день|:count дня|:count дней',
|
21 |
+
'hour' => ':count час|:count часа|:count часов',
|
22 |
+
'h' => ':count час|:count часа|:count часов',
|
23 |
+
'minute' => ':count минуту|:count минуты|:count минут',
|
24 |
+
'min' => ':count минуту|:count минуты|:count минут',
|
25 |
+
'second' => ':count секунду|:count секунды|:count секунд',
|
26 |
+
's' => ':count секунду|:count секунды|:count секунд',
|
27 |
+
'ago' => ':time назад',
|
28 |
+
'from_now' => 'через :time',
|
29 |
+
'after' => ':time после',
|
30 |
+
'before' => ':time до',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/sk.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/sk/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => 'rok|:count roky|:count rokov',
|
14 |
+
'y' => 'rok|:count roky|:count rokov',
|
15 |
+
'month' => 'mesiac|:count mesiace|:count mesiacov',
|
16 |
+
'm' => 'mesiac|:count mesiace|:count mesiacov',
|
17 |
+
'week' => 'týždeň|:count týždne|:count týždňov',
|
18 |
+
'w' => 'týždeň|:count týždne|:count týždňov',
|
19 |
+
'day' => 'deň|:count dni|:count dní',
|
20 |
+
'd' => 'deň|:count dni|:count dní',
|
21 |
+
'hour' => 'hodinu|:count hodiny|:count hodín',
|
22 |
+
'h' => 'hodinu|:count hodiny|:count hodín',
|
23 |
+
'minute' => 'minútu|:count minúty|:count minút',
|
24 |
+
'min' => 'minútu|:count minúty|:count minút',
|
25 |
+
'second' => 'sekundu|:count sekundy|:count sekúnd',
|
26 |
+
's' => 'sekundu|:count sekundy|:count sekúnd',
|
27 |
+
'ago' => 'pred :time',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => ':time neskôr',
|
30 |
+
'before' => ':time predtým',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/sl.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,30 +8,31 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/sl/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci',
|
27 |
-
'week_ago'
|
28 |
-
'day_ago'
|
29 |
-
'hour_ago'
|
30 |
-
'minute_ago'=> ':count minuto|:count minutama|:count minutami|:count minutami',
|
31 |
-
'second_ago'=> ':count sekundo|:count sekundama|:count sekundami|:count sekundami',
|
32 |
-
'ago'
|
33 |
-
'from_now'
|
34 |
-
'after'
|
35 |
-
'before'
|
36 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count leto|:count leti|:count leta|:count let',
|
14 |
+
'y' => ':count leto|:count leti|:count leta|:count let',
|
15 |
+
'month' => ':count mesec|:count meseca|:count mesece|:count mesecev',
|
16 |
+
'm' => ':count mesec|:count meseca|:count mesece|:count mesecev',
|
17 |
+
'week' => ':count teden|:count tedna|:count tedne|:count tednov',
|
18 |
+
'w' => ':count teden|:count tedna|:count tedne|:count tednov',
|
19 |
+
'day' => ':count dan|:count dni|:count dni|:count dni',
|
20 |
+
'd' => ':count dan|:count dni|:count dni|:count dni',
|
21 |
+
'hour' => ':count uro|:count uri|:count ure|:count ur',
|
22 |
+
'h' => ':count uro|:count uri|:count ure|:count ur',
|
23 |
+
'minute' => ':count minuto|:count minuti|:count minute|:count minut',
|
24 |
+
'min' => ':count minuto|:count minuti|:count minute|:count minut',
|
25 |
+
'second' => ':count sekundo|:count sekundi|:count sekunde|:count sekund',
|
26 |
+
's' => ':count sekundo|:count sekundi|:count sekunde|:count sekund',
|
27 |
+
'year_ago' => ':count letom|:count leti|:count leti|:count leti',
|
28 |
'month_ago' => ':count mesecem|:count meseci|:count meseci|:count meseci',
|
29 |
+
'week_ago' => ':count tednom|:count tednoma|:count tedni|:count tedni',
|
30 |
+
'day_ago' => ':count dnem|:count dnevoma|:count dnevi|:count dnevi',
|
31 |
+
'hour_ago' => ':count uro|:count urama|:count urami|:count urami',
|
32 |
+
'minute_ago' => ':count minuto|:count minutama|:count minutami|:count minutami',
|
33 |
+
'second_ago' => ':count sekundo|:count sekundama|:count sekundami|:count sekundami',
|
34 |
+
'ago' => 'pred :time',
|
35 |
+
'from_now' => 'čez :time',
|
36 |
+
'after' => 'čez :time',
|
37 |
+
'before' => 'pred :time',
|
38 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/sq.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 vit|:count vjet',
|
14 |
+
'y' => '1 vit|:count vjet',
|
15 |
+
'month' => '1 muaj|:count muaj',
|
16 |
+
'm' => '1 muaj|:count muaj',
|
17 |
+
'week' => '1 javë|:count javë',
|
18 |
+
'w' => '1 javë|:count javë',
|
19 |
+
'day' => '1 ditë|:count ditë',
|
20 |
+
'd' => '1 ditë|:count ditë',
|
21 |
+
'hour' => '1 orë|:count orë',
|
22 |
+
'h' => '1 orë|:count orë',
|
23 |
+
'minute' => '1 minutë|:count minuta',
|
24 |
+
'min' => '1 minutë|:count minuta',
|
25 |
+
'second' => '1 sekondë|:count sekonda',
|
26 |
+
's' => '1 sekondë|:count sekonda',
|
27 |
+
'ago' => ':time më parë',
|
28 |
+
'from_now' => ':time nga tani',
|
29 |
+
'after' => ':time pas',
|
30 |
+
'before' => ':time para',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/sr.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/sr/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count godina|:count godine|:count godina',
|
14 |
+
'y' => ':count godina|:count godine|:count godina',
|
15 |
+
'month' => ':count mesec|:count meseca|:count meseci',
|
16 |
+
'm' => ':count mesec|:count meseca|:count meseci',
|
17 |
+
'week' => ':count nedelja|:count nedelje|:count nedelja',
|
18 |
+
'w' => ':count nedelja|:count nedelje|:count nedelja',
|
19 |
+
'day' => ':count dan|:count dana|:count dana',
|
20 |
+
'd' => ':count dan|:count dana|:count dana',
|
21 |
+
'hour' => ':count sat|:count sata|:count sati',
|
22 |
+
'h' => ':count sat|:count sata|:count sati',
|
23 |
+
'minute' => ':count minut|:count minuta |:count minuta',
|
24 |
+
'min' => ':count minut|:count minuta |:count minuta',
|
25 |
+
'second' => ':count sekund|:count sekunde|:count sekunde',
|
26 |
+
's' => ':count sekund|:count sekunde|:count sekunde',
|
27 |
+
'ago' => 'pre :time',
|
28 |
+
'from_now' => ':time od sada',
|
29 |
+
'after' => 'nakon :time',
|
30 |
+
'before' => 'pre :time',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/sr_Cyrl_ME.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count године|[0,Inf[ :count година',
|
14 |
+
'y' => ':count г.',
|
15 |
+
'month' => '{1} :count мјесец|{2,3,4}:count мјесеца|[5,Inf[ :count мјесеци',
|
16 |
+
'm' => ':count мј.',
|
17 |
+
'week' => '{1} :count недјеља|{2,3,4}:count недјеље|[5,Inf[ :count недјеља',
|
18 |
+
'w' => ':count нед.',
|
19 |
+
'day' => '{1,21,31} :count дан|[2,Inf[ :count дана',
|
20 |
+
'd' => ':count д.',
|
21 |
+
'hour' => '{1,21} :count сат|{2,3,4,22,23,24}:count сата|[5,Inf[ :count сати',
|
22 |
+
'h' => ':count ч.',
|
23 |
+
'minute' => '{1,21,31,41,51} :count минут|[2,Inf[ :count минута',
|
24 |
+
'min' => ':count мин.',
|
25 |
+
'second' => '{1,21,31,41,51} :count секунд|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count секунде|[5,Inf[:count секунди',
|
26 |
+
's' => ':count сек.',
|
27 |
+
'ago' => 'прије :time',
|
28 |
+
'from_now' => 'за :time',
|
29 |
+
'after' => ':time након',
|
30 |
+
'before' => ':time прије',
|
31 |
+
|
32 |
+
'year_from_now' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
|
33 |
+
'year_ago' => '{1,21,31,41,51} :count годину|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count године|[5,Inf[ :count година',
|
34 |
+
|
35 |
+
'week_from_now' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља',
|
36 |
+
'week_ago' => '{1} :count недјељу|{2,3,4} :count недјеље|[5,Inf[ :count недјеља',
|
37 |
+
|
38 |
+
);
|
vendor/nesbot/carbon/src/Carbon/Lang/sr_Latn_ME.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count godine|[0,Inf[ :count godina',
|
14 |
+
'y' => ':count g.',
|
15 |
+
'month' => '{1} :count mjesec|{2,3,4}:count mjeseca|[5,Inf[ :count mjeseci',
|
16 |
+
'm' => ':count mj.',
|
17 |
+
'week' => '{1} :count nedjelja|{2,3,4}:count nedjelje|[5,Inf[ :count nedjelja',
|
18 |
+
'w' => ':count ned.',
|
19 |
+
'day' => '{1,21,31} :count dan|[2,Inf[ :count dana',
|
20 |
+
'd' => ':count d.',
|
21 |
+
'hour' => '{1,21} :count sat|{2,3,4,22,23,24}:count sata|[5,Inf[ :count sati',
|
22 |
+
'h' => ':count č.',
|
23 |
+
'minute' => '{1,21,31,41,51} :count minut|[2,Inf[ :count minuta',
|
24 |
+
'min' => ':count min.',
|
25 |
+
'second' => '{1,21,31,41,51} :count sekund|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count sekunde|[5,Inf[:count sekundi',
|
26 |
+
's' => ':count sek.',
|
27 |
+
'ago' => 'prije :time',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => ':time nakon',
|
30 |
+
'before' => ':time prije',
|
31 |
+
|
32 |
+
'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
33 |
+
'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
34 |
+
|
35 |
+
'week_from_now' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
36 |
+
'week_ago' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
37 |
+
|
38 |
+
);
|
vendor/nesbot/carbon/src/Carbon/Lang/sr_ME.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => '{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count godine|[0,Inf[ :count godina',
|
14 |
+
'y' => ':count g.',
|
15 |
+
'month' => '{1} :count mjesec|{2,3,4}:count mjeseca|[5,Inf[ :count mjeseci',
|
16 |
+
'm' => ':count mj.',
|
17 |
+
'week' => '{1} :count nedjelja|{2,3,4}:count nedjelje|[5,Inf[ :count nedjelja',
|
18 |
+
'w' => ':count ned.',
|
19 |
+
'day' => '{1,21,31} :count dan|[2,Inf[ :count dana',
|
20 |
+
'd' => ':count d.',
|
21 |
+
'hour' => '{1,21} :count sat|{2,3,4,22,23,24}:count sata|[5,Inf[ :count sati',
|
22 |
+
'h' => ':count č.',
|
23 |
+
'minute' => '{1,21,31,41,51} :count minut|[2,Inf[ :count minuta',
|
24 |
+
'min' => ':count min.',
|
25 |
+
'second' => '{1,21,31,41,51} :count sekund|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54}:count sekunde|[5,Inf[:count sekundi',
|
26 |
+
's' => ':count sek.',
|
27 |
+
'ago' => 'prije :time',
|
28 |
+
'from_now' => 'za :time',
|
29 |
+
'after' => ':time nakon',
|
30 |
+
'before' => ':time prije',
|
31 |
+
|
32 |
+
'year_from_now' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
33 |
+
'year_ago' => '{1,21,31,41,51} :count godinu|{2,3,4,22,23,24,32,33,34,42,43,44,52,53,54} :count godine|[5,Inf[ :count godina',
|
34 |
+
|
35 |
+
'week_from_now' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
36 |
+
'week_ago' => '{1} :count nedjelju|{2,3,4} :count nedjelje|[5,Inf[ :count nedjelja',
|
37 |
+
|
38 |
+
);
|
vendor/nesbot/carbon/src/Carbon/Lang/sv.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/sv/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 år|:count år',
|
14 |
+
'y' => '1 år|:count år',
|
15 |
+
'month' => '1 månad|:count månader',
|
16 |
+
'm' => '1 månad|:count månader',
|
17 |
+
'week' => '1 vecka|:count veckor',
|
18 |
+
'w' => '1 vecka|:count veckor',
|
19 |
+
'day' => '1 dag|:count dagar',
|
20 |
+
'd' => '1 dag|:count dagar',
|
21 |
+
'hour' => '1 timme|:count timmar',
|
22 |
+
'h' => '1 timme|:count timmar',
|
23 |
+
'minute' => '1 minut|:count minuter',
|
24 |
+
'min' => '1 minut|:count minuter',
|
25 |
+
'second' => '1 sekund|:count sekunder',
|
26 |
+
's' => '1 sekund|:count sekunder',
|
27 |
+
'ago' => ':time sedan',
|
28 |
+
'from_now' => 'om :time',
|
29 |
+
'after' => ':time efter',
|
30 |
+
'before' => ':time före',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/th.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/th/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => '1 ปี|:count ปี',
|
14 |
+
'y' => '1 ปี|:count ปี',
|
15 |
+
'month' => '1 เดือน|:count เดือน',
|
16 |
+
'm' => '1 เดือน|:count เดือน',
|
17 |
+
'week' => '1 สัปดาห์|:count สัปดาห์',
|
18 |
+
'w' => '1 สัปดาห์|:count สัปดาห์',
|
19 |
+
'day' => '1 วัน|:count วัน',
|
20 |
+
'd' => '1 วัน|:count วัน',
|
21 |
+
'hour' => '1 ชั่วโมง|:count ชั่วโมง',
|
22 |
+
'h' => '1 ชั่วโมง|:count ชั่วโมง',
|
23 |
+
'minute' => '1 นาที|:count นาที',
|
24 |
+
'min' => '1 นาที|:count นาที',
|
25 |
+
'second' => '1 วินาที|:count วินาที',
|
26 |
+
's' => '1 วินาที|:count วินาที',
|
27 |
+
'ago' => ':time ที่แล้ว',
|
28 |
+
'from_now' => ':time จากนี้',
|
29 |
+
'after' => 'หลัง:time',
|
30 |
+
'before' => 'ก่อน:time',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/tr.php
CHANGED
@@ -9,20 +9,23 @@
|
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
12 |
-
/**
|
13 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
14 |
-
* for possible formats.
|
15 |
-
*/
|
16 |
return array(
|
17 |
-
'year'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
);
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count yıl',
|
14 |
+
'y' => ':count yıl',
|
15 |
+
'month' => ':count ay',
|
16 |
+
'm' => ':count ay',
|
17 |
+
'week' => ':count hafta',
|
18 |
+
'w' => ':count hafta',
|
19 |
+
'day' => ':count gün',
|
20 |
+
'd' => ':count gün',
|
21 |
+
'hour' => ':count saat',
|
22 |
+
'h' => ':count saat',
|
23 |
+
'minute' => ':count dakika',
|
24 |
+
'min' => ':count dakika',
|
25 |
+
'second' => ':count saniye',
|
26 |
+
's' => ':count saniye',
|
27 |
+
'ago' => ':time önce',
|
28 |
+
'from_now' => ':time sonra',
|
29 |
+
'after' => ':time sonra',
|
30 |
+
'before' => ':time önce',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/uk.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/uk/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count рік|:count роки|:count років',
|
14 |
+
'y' => ':count рік|:count роки|:count років',
|
15 |
+
'month' => ':count місяць|:count місяці|:count місяців',
|
16 |
+
'm' => ':count місяць|:count місяці|:count місяців',
|
17 |
+
'week' => ':count тиждень|:count тижні|:count тижнів',
|
18 |
+
'w' => ':count тиждень|:count тижні|:count тижнів',
|
19 |
+
'day' => ':count день|:count дні|:count днів',
|
20 |
+
'd' => ':count день|:count дні|:count днів',
|
21 |
+
'hour' => ':count година|:count години|:count годин',
|
22 |
+
'h' => ':count година|:count години|:count годин',
|
23 |
+
'minute' => ':count хвилину|:count хвилини|:count хвилин',
|
24 |
+
'min' => ':count хвилину|:count хвилини|:count хвилин',
|
25 |
+
'second' => ':count секунду|:count секунди|:count секунд',
|
26 |
+
's' => ':count секунду|:count секунди|:count секунд',
|
27 |
+
'ago' => ':time назад',
|
28 |
+
'from_now' => 'через :time',
|
29 |
+
'after' => ':time після',
|
30 |
+
'before' => ':time до',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/ur.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count سال',
|
14 |
+
'month' => ':count ماه',
|
15 |
+
'week' => ':count ہفتے',
|
16 |
+
'day' => ':count روز',
|
17 |
+
'hour' => ':count گھنٹے',
|
18 |
+
'minute' => ':count منٹ',
|
19 |
+
'second' => ':count سیکنڈ',
|
20 |
+
'ago' => ':time پہلے',
|
21 |
+
'from_now' => ':time بعد',
|
22 |
+
'after' => ':time بعد',
|
23 |
+
'before' => ':time پہلے',
|
24 |
+
);
|
vendor/nesbot/carbon/src/Carbon/Lang/uz.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,21 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
/**
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
|
15 |
return array(
|
16 |
-
'year'
|
17 |
-
'
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
|
|
|
|
|
|
|
|
11 |
|
12 |
return array(
|
13 |
+
'year' => ':count yil|:count yil|:count yil',
|
14 |
+
'y' => ':count yil|:count yil|:count yil',
|
15 |
+
'month' => ':count oy|:count oy|:count oylar',
|
16 |
+
'm' => ':count oy|:count oy|:count oylar',
|
17 |
+
'week' => ':count hafta|:count hafta|:count hafta',
|
18 |
+
'w' => ':count hafta|:count hafta|:count hafta',
|
19 |
+
'day' => ':count kun|:count kun|:count kun',
|
20 |
+
'd' => ':count kun|:count kun|:count kun',
|
21 |
+
'hour' => ':count soat|:count soat|:count soat',
|
22 |
+
'h' => ':count soat|:count soat|:count soat',
|
23 |
+
'minute' => ':count minut|:count minut|:count minut',
|
24 |
+
'min' => ':count minut|:count minut|:count minut',
|
25 |
+
'second' => ':count sekund|:count sekund|:count sekund',
|
26 |
+
's' => ':count sekund|:count sekund|:count sekund',
|
27 |
+
'ago' => ':time avval',
|
28 |
+
'from_now' => ':time keyin',
|
29 |
+
'after' => ':time keyin',
|
30 |
+
'before' => ':time oldin',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/vi.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/vi/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count năm',
|
14 |
+
'y' => ':count năm',
|
15 |
+
'month' => ':count tháng',
|
16 |
+
'm' => ':count tháng',
|
17 |
+
'week' => ':count tuần',
|
18 |
+
'w' => ':count tuần',
|
19 |
+
'day' => ':count ngày',
|
20 |
+
'd' => ':count ngày',
|
21 |
+
'hour' => ':count giờ',
|
22 |
+
'h' => ':count giờ',
|
23 |
+
'minute' => ':count phút',
|
24 |
+
'min' => ':count phút',
|
25 |
+
'second' => ':count giây',
|
26 |
+
's' => ':count giây',
|
27 |
+
'ago' => ':time trước',
|
28 |
+
'from_now' => ':time từ bây giờ',
|
29 |
+
'after' => ':time sau',
|
30 |
+
'before' => ':time trước',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/zh-TW.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
* This file is part of the Carbon package.
|
4 |
-
*
|
5 |
-
* (c) Brian Nesbitt <brian@nesbot.com>
|
6 |
-
*
|
7 |
-
* For the full copyright and license information, please view the LICENSE
|
8 |
-
* file that was distributed with this source code.
|
9 |
-
*/
|
10 |
-
/**
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/zh-TW/date.php
|
16 |
-
*/
|
17 |
-
return array(
|
18 |
-
'year' => ':count 年',
|
19 |
-
'month' => ':count 月',
|
20 |
-
'week' => ':count 周',
|
21 |
-
'day' => ':count 天',
|
22 |
-
'hour' => ':count 小時',
|
23 |
-
'minute' => ':count 分鐘',
|
24 |
-
'second' => ':count 秒',
|
25 |
-
'ago' => ':time前',
|
26 |
-
'from_now' => '距現在 :time',
|
27 |
-
'after' => ':time後',
|
28 |
-
'before' => ':time前'
|
29 |
-
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vendor/nesbot/carbon/src/Carbon/Lang/zh.php
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
<?php
|
|
|
2 |
/*
|
3 |
* This file is part of the Carbon package.
|
4 |
*
|
@@ -7,23 +8,24 @@
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
8 |
* file that was distributed with this source code.
|
9 |
*/
|
10 |
-
|
11 |
-
* Translation messages. See http://symfony.com/doc/current/book/translation.html
|
12 |
-
* for possible formats.
|
13 |
-
*/
|
14 |
-
/**
|
15 |
-
* Extracted from https://github.com/jenssegers/laravel-date/blob/master/src/lang/zh/date.php
|
16 |
-
*/
|
17 |
return array(
|
18 |
-
'year'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
'
|
24 |
-
'
|
25 |
-
'
|
26 |
-
'
|
27 |
-
'
|
28 |
-
'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
);
|
1 |
<?php
|
2 |
+
|
3 |
/*
|
4 |
* This file is part of the Carbon package.
|
5 |
*
|
8 |
* For the full copyright and license information, please view the LICENSE
|
9 |
* file that was distributed with this source code.
|
10 |
*/
|
11 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
return array(
|
13 |
+
'year' => ':count年',
|
14 |
+
'y' => ':count年',
|
15 |
+
'month' => ':count个月',
|
16 |
+
'm' => ':count个月',
|
17 |
+
'week' => ':count周',
|
18 |
+
'w' => ':count周',
|
19 |
+
'day' => ':count天',
|
20 |
+
'd' => ':count天',
|
21 |
+
'hour' => ':count小时',
|
22 |
+
'h' => ':count小时',
|
23 |
+
'minute' => ':count分钟',
|
24 |
+
'min' => ':count分钟',
|
25 |
+
'second' => ':count秒',
|
26 |
+
's' => ':count秒',
|
27 |
+
'ago' => ':time前',
|
28 |
+
'from_now' => '距现在:time',
|
29 |
+
'after' => ':time后',
|
30 |
+
'before' => ':time前',
|
31 |
);
|
vendor/nesbot/carbon/src/Carbon/Lang/zh_TW.php
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
* This file is part of the Carbon package.
|
5 |
+
*
|
6 |
+
* (c) Brian Nesbitt <brian@nesbot.com>
|
7 |
+
*
|
8 |
+
* For the full copyright and license information, please view the LICENSE
|
9 |
+
* file that was distributed with this source code.
|
10 |
+
*/
|
11 |
+
|
12 |
+
return array(
|
13 |
+
'year' => ':count 年',
|
14 |
+
'y' => ':count 年',
|
15 |
+
'month' => ':count 月',
|
16 |
+
'm' => ':count 月',
|
17 |
+
'week' => ':count 周',
|
18 |
+
'w' => ':count 周',
|
19 |
+
'day' => ':count 天',
|
20 |
+
'd' => ':count 天',
|
21 |
+
'hour' => ':count 小時',
|
22 |
+
'h' => ':count 小時',
|
23 |
+
'minute' => ':count 分鐘',
|
24 |
+
'min' => ':count 分鐘',
|
25 |
+
'second' => ':count 秒',
|
26 |
+
's' => ':count 秒',
|
27 |
+
'ago' => ':time前',
|
28 |
+
'from_now' => '距現在 :time',
|
29 |
+
'after' => ':time後',
|
30 |
+
'before' => ':time前',
|
31 |
+
);
|
vendor/symfony/translation/Util/ArrayConverter.php
CHANGED
@@ -62,7 +62,7 @@ class ArrayConverter
|
|
62 |
* $tree['foo'] was string before we found array {bar: test2}.
|
63 |
* Treat new element as string too, e.g. add $tree['foo.bar'] = 'test2';
|
64 |
*/
|
65 |
-
$elem = &$elem[
|
66 |
break;
|
67 |
}
|
68 |
$parentOfElem = &$elem;
|
62 |
* $tree['foo'] was string before we found array {bar: test2}.
|
63 |
* Treat new element as string too, e.g. add $tree['foo.bar'] = 'test2';
|
64 |
*/
|
65 |
+
$elem = &$elem[implode('.', array_slice($parts, $i))];
|
66 |
break;
|
67 |
}
|
68 |
$parentOfElem = &$elem;
|
views/settings/mta.html
CHANGED
@@ -73,7 +73,7 @@
|
|
73 |
<br/>
|
74 |
<br/>
|
75 |
<a
|
76 |
-
href="https://account.mailpoet.com?s=<%= total_subscribers
|
77 |
class="button button-primary"
|
78 |
target="_blank"
|
79 |
><%= __('View Email Plans') %></a>
|
73 |
<br/>
|
74 |
<br/>
|
75 |
<a
|
76 |
+
href="https://account.mailpoet.com?s=<%= total_subscribers %>&utm_source=plugin&utm_campaign=purchase&utm_medium=settings"
|
77 |
class="button button-primary"
|
78 |
target="_blank"
|
79 |
><%= __('View Email Plans') %></a>
|