-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathGRC.coffee
38 lines (31 loc) · 2.68 KB
/
GRC.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Phone = require('../Phone')
PhoneNumber = require('../PhoneNumber')
# For more info check:
# https://en.wikipedia.org/wiki/Telephone_numbers_in_Greece
class Greece
constructor: ->
@countryName = "Greece"
@countryNameAbbr = "GRC"
@countryCode = '30'
@regex = /^(?:(?:(?:\+|)(?:30|)|))(?:(?:[2,6]\d{6,9}))$/
@optionalTrunkPrefix = '0'
@nationalNumberSeparator = ' '
@nationalDestinationCode =
[
'210','211','212','213','214','215','216','217','218','219','261','271','281','690','693','694','695','697','698','699','2221','2222','2223','2224','2226','2227','2228','2229','2231','2232','2233','2234','2235','2236','2237','2238','2241','2242','2243','2244','2245','2246','2247','2251','2252','2253','2254','2261','2262','2263','2264','2265','2266','2267','2268','2271','2272','2273','2274','2275','2281','2282','2283','2284','2285','2286','2287','2288','2289','2291','2292','2293','2294','2295','2296','2297','2298','2299','2310','2311','2312','2313','2314','2315','2316','2317','2318','2319','2321','2322','2323','2324','2325','2327','2331','2332','2333','2341','2343','2351','2352','2353','2371','2372','2373','2374','2375','2376','2377','2381','2382','2383','2384','2385','2386','2391','2392','2393','2394','2395','2396','2397','2399','2410','2411','2412','2413','2414','2415','2416','2417','2421','2422','2423','2424','2425','2426','2427','2428','2431','2432','2433','2434','2441','2442','2443','2444','2445','2461','2462','2463','2464','2465','2467','2468','2491','2492','2493','2494','2495','2521','2522','2523','2524','2531','2532','2533','2534','2535','2541','2542','2544','2551','2552','2553','2554','2555','2556','2591','2592','2593','2594','2621','2622','2623','2624','2625','2626','2631','2632','2634','2635','2641','2642','2643','2644','2645','2646','2647','2651','2652','2653','2654','2655','2656','2657','2658','2659','2661','2662','2663','2664','2665','2666','2671','2674','2681','2682','2683','2684','2685','2691','2692','2693','2694','2695','2696','2721','2722','2723','2724','2725','2731','2732','2733','2734','2735','2736','2741','2742','2743','2744','2746','2747','2751','2752','2753','2754','2755','2757','2761','2763','2765','2791','2792','2795','2796','2797','2821','2822','2823','2824','2825','2831','2832','2833','2834','2841','2842','2843','2844','2891','2892','2893','2894','2895','2896','2897'
]
specialRules: (withoutCountryCode, withoutNDC, ndc) =>
phone = new PhoneNumber(@countryNameAbbr, @countryCode, ndc, withoutNDC)
if ndc.indexOf("6") is 0
phone.isMobile = true
return phone
else
phone.isMobile = false
return phone
splitNumber: (number) =>
return [number]
# register
greece = new Greece()
Phone.countries['30'] = greece
# exports
module.exports = greece