MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / getToday

Function getToday

core/src/components/datetime/utils/data.ts:27–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25 * time zone.
26 */
27export const getToday = () => {
28 /**
29 * ion-datetime intentionally does not
30 * parse time zones/do automatic time zone
31 * conversion when accepting user input.
32 * However when we get today's date string,
33 * we want it formatted relative to the user's
34 * time zone.
35 *
36 * When calling toISOString(), the browser
37 * will convert the date to UTC time by either adding
38 * or subtracting the time zone offset.
39 * To work around this, we need to either add
40 * or subtract the time zone offset to the Date
41 * object prior to calling toISOString().
42 * This allows us to get an ISO string
43 * that is in the user's time zone.
44 */
45 return removeDateTzOffset(new Date()).toISOString();
46};
47
48const minutes = [
49 0, 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,

Callers 2

componentWillLoadMethod · 0.90
data.spec.tsFile · 0.90

Calls 1

removeDateTzOffsetFunction · 0.90

Tested by

no test coverage detected