MCPcopy Index your code
hub / github.com/MALSync/MALSync / constructor

Method constructor

src/utils/IntlWrapper.ts:210–224  ·  view source on GitHub ↗
(
    date: Date | number | string,
    locale: Intl.LocalesArgument = api.storage.lang('locale'),
  )

Source from the content-addressed store, hash-verified

208 protected locale: Intl.LocalesArgument;
209
210 constructor(
211 date: Date | number | string,
212 locale: Intl.LocalesArgument = api.storage.lang('locale'),
213 ) {
214 this.locale = locale;
215 if (typeof date === 'string') {
216 const number = Number(date);
217 if (!Number.isNaN(number)) {
218 this.date = new Date(number);
219 return this;
220 }
221 }
222 this.date = new Date(date);
223 return this;
224 }
225
226 // Setters
227 setDate(date: Date | number | string) {

Callers

nothing calls this directly

Calls 1

langMethod · 0.80

Tested by

no test coverage detected