@@ -22,16 +22,14 @@ import { createBaseURL, toSnakeCase } from "@/utils";
22
22
23
23
const branchNameRegEx = / [ ^ a - z 0 - 9 _ ] + / ;
24
24
25
- function formatDate ( date ) {
26
- const map = {
25
+ function dateComponents ( date ) {
26
+ return {
27
27
mm : ( "0" + ( date . getMonth ( ) + 1 ) ) . slice ( - 2 ) ,
28
28
dd : ( "0" + date . getDate ( ) ) . slice ( - 2 ) ,
29
- yy : ( "0 " + date . getFullYear ( ) ) . slice ( - 2 ) ,
29
+ yy : ( "000 " + date . getFullYear ( ) ) . slice ( - 4 ) ,
30
30
HH : ( "0" + date . getHours ( ) ) . slice ( - 2 ) ,
31
31
MinMin : ( "0" + date . getMinutes ( ) ) . slice ( - 2 ) ,
32
32
} ;
33
-
34
- return `${ map . mm } ${ map . dd } ${ map . yy } _${ map . HH } _${ map . MinMin } ` ;
35
33
}
36
34
37
35
export const StartProject = ( ) => {
@@ -44,7 +42,8 @@ export const StartProject = () => {
44
42
45
43
const findDefaultBranchName = useCallback ( ( ) => {
46
44
if ( taxonomyName === "" || ownerName === "" ) return "" ;
47
- return `${ formatDate ( new Date ( ) ) } _${ taxonomyName } _${ ownerName } `
45
+ const date = dateComponents ( new Date ( ) ) ;
46
+ return `${ date . yy } _${ date . mm } _${ date . dd } _${ ownerName } _${ taxonomyName } `
48
47
. replace ( / [ \s - ] + / g, "_" )
49
48
. toLowerCase ( ) ;
50
49
} , [ ownerName , taxonomyName ] ) ;
@@ -191,7 +190,7 @@ export const StartProject = () => {
191
190
>
192
191
Explain what is your goal with this new project, what changes are
193
192
you going to bring. Remember to privilege small projects (do big
194
- project as a succession of small one ).
193
+ project as a succession of small ones ).
195
194
</ FormHelperText >
196
195
197
196
< Button
0 commit comments