Sellcodes
  • Browse
    • Login
    • Sign Up
  • Users are requesting the codes...
  • See all requests

Moment.js (_d and _i)

I am using moment.js in this project.
I would like to put the date entered in the datetimepicker. I obtain the value of the input in the following format.

saltValue: "08052018"
value: "08.05.2018"
__proto__
: constructor
: ƒ Object() hasOwnProperty
: ƒ hasOwnProperty() isPrototypeOf
: ƒ isPrototypeOf() propertyIsEnumerable
: ƒ propertyIsEnumerable() toLocaleString
: ƒ toLocaleString() toString
: ƒ toString() valueOf
: ƒ valueOf() __defineGetter__

Which I want to convert with the following function.

let dateValue = getDateValue(inputValue);
static getDateValue(value) {
return Moment.utc(value);
}
şu kısım da ise set etmetedir.

let newDate = dateValue._d;
this.setState({
initialDate: newDate,
displayDate: getFirstDayOfMonth(newDate),
selectedDate: newDate,
});

But, the dateValue variable has an old date in parameter _d and a new date in the parameter _i. So the _d and _i property variables are not the same. The _d parameters are used in different parts of the project. So I have to get my new date in _d format every time. How can I do this?

_i property;
"08052019"
value:"08.05.2019"
__proto__
:constructor
:ƒ Object()hasOwnProperty
:ƒ hasOwnProperty()isPrototypeOf
:ƒ isPrototypeOf()propertyIsEnumerable
:ƒ propertyIsEnumerable()toLocaleString
:ƒ toLocaleString()toString
:ƒ toString()valueOf
:ƒ valueOf()__defineGetter__
:ƒ __defineGetter__()__defineSetter__
:ƒ __defineSetter__()__lookupGetter__
:ƒ __lookupGetter__()__lookupSetter__
:ƒ __lookupSetter__()get __proto__
:ƒ __proto__()set __proto__
:ƒ __proto__()_isAMomentObject
:true_isUTC
:true_isValid
:true

_d property;
__proto__
:constructor
:ƒ Date() getDate
:ƒ getDate() getDay
:ƒ getDay() getFullYear
:ƒ getFullYear() getHours
:ƒ getHours() getMilliseconds
:ƒ getMilliseconds() getMinutes
:ƒ getMinutes() getMonth
:ƒ getMonth() getSeconds
:ƒ getSeconds()getTime
:ƒ getTime()getTimezoneOffset
:ƒ getTimezoneOffset()getUTCDate
:ƒ getUTCDate()getUTCDay
:ƒ getUTCDay()getUTCFullYear
:ƒ getUTCFullYear()getUTCHours
:ƒ getUTCHours()getUTCMilliseconds
:ƒ getUTCMilliseconds()getUTCMinutes
:ƒ getUTCMinutes()getUTCMonth
:ƒ getUTCMonth()getUTCSeconds
:ƒ getUTCSeconds()getYear
:ƒ getYear()setDate
:ƒ setDate()setFullYear
:ƒ setFullYear()setHours
:ƒ setHours()setMilliseconds
:ƒ setMilliseconds()setMinutes
:ƒ setMinutes()setMonth
:ƒ setMonth()setSeconds
:ƒ setSeconds()setTime
:ƒ setTime()setUTCDate
:ƒ setUTCDate()setUTCFullYear
:ƒ setUTCFullYear()setUTCHours
:ƒ setUTCHours() setUTCMilliseconds
:ƒ setUTCMilliseconds()setUTCMinutes
:ƒ setUTCMinutes()setUTCMonth
:ƒ setUTCMonth()setUTCSeconds
:ƒ setUTCSeconds() setYear
:ƒ setYear() toDateString
:ƒ toDateString() toGMTString
:ƒ toUTCString() toISOString
:ƒ toISOString() toJSON
:ƒ ()toLocaleDateString
:ƒ toLocaleDateString()toLocaleString
:ƒ toLocaleString()toLocaleTimeString
:ƒ toLocaleTimeString()toString
:ƒ toString()toTimeString
:ƒ toTimeString()toUTCString
:ƒ toUTCString()valueOf
:ƒ valueOf()Symbol(Symbol.toPrimitive)
:ƒ [Symbol.toPrimitive]()

link-img

1

# Users who requested
the code (so far)

link-img

$9

Suggested price from buyers
at which they’d buy

link-img

$9

Potential revenues from requesters (actual
revenues can be significantly higher)

Time of last request:on May 9, 2018

Tags:javascript, react.js, moment.js

Sellers

If you own such codes, please set up an offer and then invite users to it by clicking on «Invite to offer».

Invite to offer

Buyers

If you’re also be willing to buy those codes then click on «I’d also buy it» (no commitment to buy, but please only click when you’re serious about it).

I'd also buy it!

Tell people about Sellcodes and get 20-40% on every resulting sale!

Spread the word
  • PARTICIPATE
  • Buy
  • Offer
  • Share
  • LEARN
  • About
  • Blog
  • FAQ
  • CONNECT
  • Twitter
  • Facebook
  • Contact
  • LEGAL
  • Terms
  • Privacy
  • © 2025 Sellcodes
Log in to your Sellcodes account
Keep me logged in Forgot your password?
Looking to create an account?
Sign up for Sellcodes
By creating an account you agree to our Terms Of Use and Privacy Policy
Did you mean to Login?