Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dates not showing submitted value from saved record #91

Closed
BarryGibson opened this issue Nov 4, 2016 · 4 comments
Closed

Dates not showing submitted value from saved record #91

BarryGibson opened this issue Nov 4, 2016 · 4 comments

Comments

@BarryGibson
Copy link
Contributor

Hi,

When you re-display a form that has a date field it doesn't show the date.

To solve this, I have overidden the SubmittedValue in the DateField.cs file:

public override string SubmittedValue
{
	get
	{
		DateTime submittedValue;
		if(DateTime.TryParse(base.SubmittedValue, out submittedValue))
		{
			return submittedValue.ToString("yyyy-MM-dd");
		}
		return base.SubmittedValue;
	}
	protected set
	{
		base.SubmittedValue = value;
	}
}

I'm not sure if this is your prefered approach, but I thought I would share my problem and solution.

@kjac
Copy link
Owner

kjac commented Nov 5, 2016

Hey @BarryGibson,

Thank you for reporting and for the suggested fix.

It looks like there's an issue with async submission of dates - they append time/timezone info. It's an angular thing that's easily fixable, but before I fix it, I need to know one thing... how do the submitted dates look in your backend? Without your applied fix, that is.

@BarryGibson
Copy link
Contributor Author

Hi @kjac,

Here is an example:
2016-11-02T13:00:00.000Z

I think you are correct, because the ones collected through a different Sync version of the form don't include the time info.

Thanks

Barry

@kjac
Copy link
Owner

kjac commented Nov 5, 2016

Cool, apparently it's a feature in angularjs...

I'll have a fix ready soon, today hopefully.

On Nov 5, 2016 9:00 AM, "Barry Gibson" [email protected] wrote:

Hi @kjac https://github.com/kjac,

Here is an example:
2016-11-02T13:00:00.000Z

I think you are correct, because the ones collected through a different
Sync version of the form don't include the time info.

Thanks

Barry


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#91 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AHD_CoThTxZjoGcEifXAmueug5_Dplrbks5q7DeSgaJpZM4KpZIE
.

@kjac kjac closed this as completed in f95d25c Nov 6, 2016
@kjac
Copy link
Owner

kjac commented Nov 6, 2016

@BarryGibson it's fixed... I'll roll out a release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants