Slide 1

Slide 1 text

From ㍻ to U+32FF From ㍻ to U+32FF From ㍻ to U+32FF From ㍻ to U+32FF MITSUBOSHI Yuya

Slide 2

Slide 2 text

From ㍻ to U+32FF From ㍻ to U+32FF From ㍻ to U+32FF From ㍻ to MITSUBOSHI Yuya

Slide 3

Slide 3 text

Self-Introduction MITSUBOSHI Yuya (三星祐也) - GitHub: @MITSUBOSHI - Twitter: @Y_MITSUBOSHI - Working for Money Forward, inc. - Born in Heisei (平成) 5

Slide 4

Slide 4 text

2019 is a Big Year for Accounting Software in Japan - Change of Gengo (Japanese Era Name) - 平成(Heisei) -> 令和(Reiwa) - From 2019/05: less than half a month left - Change of Consumption Tax Rate - 8% -> 10% and multiple tax rates (+ reduced tax rate) will be introduced - From 2019/10: still more than 5 months left

Slide 5

Slide 5 text

What gengo is *quoted from wikipedia

Slide 6

Slide 6 text

What gengo is: briefly - Gengo is one of the year numbering system used in Japan - It is convertible to Christian Era (Heisei 31 -> 2019) - Gengo changes when the Emperor changes

Slide 7

Slide 7 text

Schedule New Japanese era name Announced April May Golden Week 1st 27 6 18 20 RubyKaigi 2019 Reiwa (令和) Heisei (平成)

Slide 8

Slide 8 text

How our system use Japanese era 2019

Slide 9

Slide 9 text

How our system use Japanese era 2019 Tax Office

Slide 10

Slide 10 text

How our system use Japanese era 2019 Tax Office 平成31

Slide 11

Slide 11 text

How our system use Japanese era Bank Other Company 2019 Tax Office 平成31

Slide 12

Slide 12 text

How our system use Japanese era Bank Other Company 2019 Tax Office 平成31 平成31

Slide 13

Slide 13 text

How our system use Japanese era Bank Other Company 2019 Tax Office 平成31 H.31 平成31

Slide 14

Slide 14 text

How our system use Japanese era Bank Other Company 2019 Tax Office 平成31 h31 平成31 H.31

Slide 15

Slide 15 text

Patterns of usage of Japanese era - Pattern 1. Christian era (Our System) -> Japanese era (Other System) - Pattern 2. Japanese era (Other System) -> Christian era (Our System)

Slide 16

Slide 16 text

Pattern 1. Christian era -> Japanese era - Examples: - 2019/04/30 -> 平成31年04月30日 - 2019/05/01 -> 令和01年05月01日 - We have only to care about the format of converted result (right-hand side) - That is because the original format (left-hand side) is stored in our DB as date type

Slide 17

Slide 17 text

Pattern 2. Japanese era -> Christian era - Examples: - 平成31年04月30日 -> 2019/04/30 - 令和01年05月01日 -> 2019/05/01

Slide 18

Slide 18 text

Pattern 2. Japanese era -> Christian era - Examples: - 平成31年04月30日 -> 2019/04/30 - 令和01年05月01日 -> 2019/05/01 - 平成31年05月01日 -> ???

Slide 19

Slide 19 text

Pattern 2. Japanese era -> Christian era - Examples: - 平成31年04月30日 -> 2019/04/30 - 令和01年05月01日 -> 2019/05/01 - 平成31年05月01日 -> 2019/05/01 #<- should be convertible

Slide 20

Slide 20 text

Pattern 2. Japanese era -> Christian era - Examples: - 平成31年04月30日 -> 2019/04/30 - 令和01年05月01日 -> 2019/05/01 - 平成31年05月01日 -> 2019/05/01 #<- should be convertible - 令和01年04月30日 -> 2019/04/30 #<- should be convertible

Slide 21

Slide 21 text

Pattern 2. Japanese era -> Christian era - Examples: - 平成31年04月30日 -> 2019/04/30 - 令和01年05月01日 -> 2019/05/01 - 平成31年05月01日 -> 2019/05/01 #<- should be convertible - 令和01年04月30日 -> 2019/04/30 #<- should be convertible - 令和元年05月01日 -> 2019/05/01 #<- should be convertible * “元年” means origin year. it’s used for year 1 of an era.

Slide 22

Slide 22 text

Pattern 2. Requirements - 1. 令和{0,}1 #Kanji + half-width number - 2. 令和{0,}1 #Kanji + full-width number - 3. 令和元 #Kanji + 元年(origin year) - 4. R{0,}1 #Capital R without dot - 5. R.{0, 1} #Captial R with dot - 6. r.{0, 1} #samll r with dot - 7. 2019 #half-width number - 8. 2019 #full-width number - 9. Others (1~8 + some unnecessary characters or spaces may be included) *Needless to say, “平成”(the current Gengo) must be covered

Slide 23

Slide 23 text

Ecosystem around Japanese era - Date#jisx0301 - Ruby 2.6.3 was released yesterday - gem “wareki” - gem “era_ja” - They are nice! But none of them satisfy all our system’s unique requirements (before I mentioned).

Slide 24

Slide 24 text

All of our steps 1. Investigate the code which must be modified. 2. Add test codes 3. Refactor the code 4. Make the code compatible with “Reiwa (令和)”

Slide 25

Slide 25 text

3. Refactor the code: the original code

Slide 26

Slide 26 text

3. Refactor the code: if statement part

Slide 27

Slide 27 text

3. Refactor the code: add Reiwa to RE?

Slide 28

Slide 28 text

3. Refactor the code: add Reiwa to RE? Only for Heisei (平成)

Slide 29

Slide 29 text

3. Refactor the code: add elsif statement for Reiwa?

Slide 30

Slide 30 text

3. Refactor the code: After 1

Slide 31

Slide 31 text

3. Refactor the code: After 2

Slide 32

Slide 32 text

3. Refactor the code: After final

Slide 33

Slide 33 text

4. Make the code compatible with “Reiwa(令和)”

Slide 34

Slide 34 text

Conclusion - This talk was about the change of gengo and how our team dealt with it - The current Japanese era “Heisei (平成)” will end soon - Look forward to the new Japanese era “Reiwa (令和)” - We’re hiring!!