* Return a human readable representation of a moment that can * also be evaluated to get a new moment which is the same * * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
()
| 3945 | * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects |
| 3946 | */ |
| 3947 | function inspect() { |
| 3948 | if (!this.isValid()) { |
| 3949 | return 'moment.invalid(/* ' + this._i + ' */)'; |
| 3950 | } |
| 3951 | var func = 'moment', |
| 3952 | zone = '', |
| 3953 | prefix, |
| 3954 | year, |
| 3955 | datetime, |
| 3956 | suffix; |
| 3957 | if (!this.isLocal()) { |
| 3958 | func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; |
| 3959 | zone = 'Z'; |
| 3960 | } |
| 3961 | prefix = '[' + func + '("]'; |
| 3962 | year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; |
| 3963 | datetime = '-MM-DD[T]HH:mm:ss.SSS'; |
| 3964 | suffix = zone + '[")]'; |
| 3965 | |
| 3966 | return this.format(prefix + year + datetime + suffix); |
| 3967 | } |
| 3968 | |
| 3969 | function format(inputString) { |
| 3970 | if (!inputString) { |
nothing calls this directly
no outgoing calls
no test coverage detected