Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
c5df4fd9
Commit
c5df4fd9
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge pull request #2240 from genezys/develop
Add support for configurable first day of week
parents
6a081fe8
eb90e012
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/core/datepicker.php
+11
-25
11 additions, 25 deletions
htdocs/core/datepicker.php
with
11 additions
and
25 deletions
htdocs/core/datepicker.php
+
11
−
25
View file @
c5df4fd9
...
...
@@ -27,7 +27,7 @@
*/
if
(
!
defined
(
'NOREQUIREUSER'
))
define
(
'NOREQUIREUSER'
,
'1'
);
// Not disabled cause need to load personalized language
if
(
!
defined
(
'NOREQUIREDB'
))
define
(
'NOREQUIREDB'
,
'1'
);
// Not disabled cause need to load personalized language
//
if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
if
(
!
defined
(
'NOREQUIRESOC'
))
define
(
'NOREQUIRESOC'
,
'1'
);
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
if
(
!
defined
(
'NOCSRFCHECK'
))
define
(
'NOCSRFCHECK'
,
1
);
...
...
@@ -186,27 +186,13 @@ function displayBox($selectedDate,$month,$year)
</tr>
<tr
class=
"dpDayNames"
>
<?php
$startday
=
isset
(
$conf
->
global
->
MAIN_START_WEEK
)
?
$conf
->
global
->
MAIN_START_WEEK
:
1
;
if
(
$startday
==
1
)
{
?>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortMonday"
)
?>
</td>
<td
width=
"15%"
>
<?php
echo
$langs
->
trans
(
"ShortTuesday"
)
?>
</td>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortWednesday"
)
?>
</td>
<td
width=
"15%"
>
<?php
echo
$langs
->
trans
(
"ShortThursday"
)
?>
</td>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortFriday"
)
?>
</td>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortSaturday"
)
?>
</td>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortSunday"
)
?>
</td>
<?php
}
else
{
?>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortSunday"
)
?>
</td>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortMonday"
)
?>
</td>
<td
width=
"15%"
>
<?php
echo
$langs
->
trans
(
"ShortTuesday"
)
?>
</td>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortWednesday"
)
?>
</td>
<td
width=
"15%"
>
<?php
echo
$langs
->
trans
(
"ShortThursday"
)
?>
</td>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortFriday"
)
?>
</td>
<td
width=
"14%"
>
<?php
echo
$langs
->
trans
(
"ShortSaturday"
)
?>
</td>
<?php
}
?>
$first_day_of_week
=
isset
(
$conf
->
global
->
MAIN_START_WEEK
)
?
(
int
)
$conf
->
global
->
MAIN_START_WEEK
:
0
;
$day_names
=
array
(
'ShortSunday'
,
'ShortMonday'
,
'ShortTuesday'
,
'ShortWednesday'
,
'ShortThursday'
,
'ShortFriday'
,
'ShortSaturday'
);
for
(
$i
=
0
;
$i
<
7
;
$i
++
)
{
echo
'<td width="'
,
(
int
)
((
$i
+
1
)
*
100
/
7
)
-
(
int
)
(
$i
*
100
/
7
),
'%">'
,
$langs
->
trans
(
$day_names
[(
$i
+
$first_day_of_week
)
%
7
]),
'</td>'
,
"
\n
"
;
}
?>
</tr>
<?php
//print "x ".$thedate." y";
...
...
@@ -222,7 +208,7 @@ function displayBox($selectedDate,$month,$year)
{
echo
"<TR class=
\"
dpWeek
\"
>"
;
$cols
=
0
;
for
(
$i
=
0
;
$i
<
$mydate
[
"wday"
];
$i
++
)
for
(
$i
=
0
;
$i
<
(
$mydate
[
"wday"
]
+
7
-
$first_day_of_week
)
%
7
;
$i
++
)
{
echo
"<TD> </TD>"
;
$cols
++
;
...
...
@@ -230,7 +216,7 @@ function displayBox($selectedDate,$month,$year)
}
else
{
if
(
$mydate
[
"wday"
]
==
0
)
if
(
$mydate
[
"wday"
]
==
$first_day_of_week
)
{
echo
"<TR class=
\"
dpWeek
\"
>"
;
$cols
=
0
;
...
...
@@ -254,7 +240,7 @@ function displayBox($selectedDate,$month,$year)
echo
">"
.
sprintf
(
"%02s"
,
$mydate
[
"mday"
])
.
"</TD>"
;
$cols
++
;
if
(
$mydate
[
"wday"
]
==
6
)
echo
"</TR>
\n
"
;
if
(
$mydate
!=
$firstdate
&&
$mydate
[
"wday"
]
==
((
$first_day_of_week
+
6
)
%
7
)
)
echo
"</TR>
\n
"
;
//$thedate=strtotime("tomorrow",$thedate);
$day
++
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment